Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdmlib / cdmlib-persistence / src / main / resources / eu / etaxonomy / cdm / hibernate.cfg.xml @ ace720cf

History | View | Annotate | Download (15.2 KB)

1
<?xml version="1.0" encoding="UTF-8"?>
2
<!DOCTYPE hibernate-configuration PUBLIC
3
 "-//Hibernate/Hibernate Configuration DTD 3.0//EN"
4
 "http://www.hibernate.org/dtd/hibernate-configuration-3.0.dtd">
5

    
6
<hibernate-configuration>
7
    <session-factory>
8

    
9
      <property name="connection.release_mode">after_transaction</property>
10

    
11
      <!-- Connection Pooling -->
12
<!--       <property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property> -->
13
      <property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.DatasourceConnectionProviderImpl</property>
14
            <!--
15
          Configuring the C3P0ConnectionProvider
16
          ========================================
17
          see http://www.mchange.com/projects/c3p0/index.html#hibernate-specific
18
          and also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource)
19

20
          IMPORTANT:
21
          Because of the constraint (1) the org.hibernate.connection.C3P0ConnectionProvider are not be used
22
          for the Cdm Library because it requires the dataSource bean in some cases.
23

24
          (1)
25
          Do NOT specify the dataSource in the sessionFactory for example in the
26
          org.springframework.orm.hibernate3.LocalSessionFactoryBean
27
          !!!==> If *dataSource* is set, this will override corresponding settings in Hibernate properties.!!!
28
                          If this is set, the Hibernate settings should not define a connection provider to
29
                      avoid meaningless double configuration.
30
          (2)
31
          Hibernate uses the hibernate.c3p0.max_size property to determine if c3p0
32
          is beeing used.  Therefore the max_size property MUST be set. - maybe not need in hibernate 3.4 +
33

34
          (3) If you are using Hibernate's C3P0ConnectionProvider you must set the following properties
35
          in your hibernate configuration, using hibernate-specific configuration keys.
36
          All other properties must be defined as usual in a c3p0.properties file.
37
          This is confusing, and will hopefully be simplified some time in the future, but for now...
38

39
            hibernate.c3p0.acquire_increment
40
                        hibernate.c3p0.idle_test_period
41
                        hibernate.c3p0.timeout
42
                        hibernate.c3p0.max_size
43
                        hibernate.c3p0.max_statements
44
                        hibernate.c3p0.min_size
45
                        hibernate.c3p0.validate
46
      -->
47
      <mapping package="eu.etaxonomy.cdm.model.common"/>
48
      <!-- Annotation Package -->
49
      <mapping class="eu.etaxonomy.cdm.model.agent.Address"/>
50
      <mapping class="eu.etaxonomy.cdm.model.agent.AgentBase"/>
51
      <mapping class="eu.etaxonomy.cdm.model.agent.Contact"/>
52
      <mapping class="eu.etaxonomy.cdm.model.agent.Institution"/>
53
      <mapping class="eu.etaxonomy.cdm.model.agent.InstitutionalMembership"/>
54
      <mapping class="eu.etaxonomy.cdm.model.agent.InstitutionType"/>
55
      <mapping class="eu.etaxonomy.cdm.model.agent.Person"/>
56
      <mapping class="eu.etaxonomy.cdm.model.agent.Team"/>
57
      <mapping class="eu.etaxonomy.cdm.model.agent.TeamOrPersonBase"/>
58
      <!-- Common Package -->
59
      <mapping class="eu.etaxonomy.cdm.model.common.Annotation"/>
60
      <mapping class="eu.etaxonomy.cdm.model.common.AnnotationType"/>
61
      <mapping class="eu.etaxonomy.cdm.model.common.CdmMetaData"/>
62
      <mapping class="eu.etaxonomy.cdm.model.common.CdmPreferences"/>
63
      <mapping class="eu.etaxonomy.cdm.model.common.Credit"/>
64
      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTerm"/>
65
      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTermBase"/>
66
      <mapping class="eu.etaxonomy.cdm.model.common.Extension"/>
67
      <mapping class="eu.etaxonomy.cdm.model.common.ExtensionType"/>
68
      <mapping class="eu.etaxonomy.cdm.model.common.IdentifiableSource"/>
69
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementSource"/>
70
      <mapping class="eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl"/>
71
      <mapping class="eu.etaxonomy.cdm.model.common.Group"/>
72
      <mapping class="eu.etaxonomy.cdm.model.common.Language"/>
73
      <mapping class="eu.etaxonomy.cdm.model.common.LanguageString"/>
74
      <mapping class="eu.etaxonomy.cdm.model.common.LSID"/>
75
      <mapping class="eu.etaxonomy.cdm.model.common.LSIDAuthority"/>
76
      <mapping class="eu.etaxonomy.cdm.model.common.Marker"/>
77
      <mapping class="eu.etaxonomy.cdm.model.common.MarkerType"/>
78
      <mapping class="eu.etaxonomy.cdm.model.common.MaterialAndMethod"/>
79
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermBase"/>
80
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermVocabulary"/>
81
      <mapping class="eu.etaxonomy.cdm.model.common.OriginalSourceBase"/>
82
      <mapping class="eu.etaxonomy.cdm.model.common.RelationshipTermBase"/>
83
      <mapping class="eu.etaxonomy.cdm.model.common.Representation"/>
84
      <mapping class="eu.etaxonomy.cdm.model.common.TermVocabulary"/>
85
      <mapping class="eu.etaxonomy.cdm.model.common.User"/>
86
      <!-- Description Package -->
87
      <mapping class="eu.etaxonomy.cdm.model.description.AbsenceTerm"/>
88
      <mapping class="eu.etaxonomy.cdm.model.description.CategoricalData"/>
89
      <mapping class="eu.etaxonomy.cdm.model.description.CommonTaxonName"/>
90
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionBase"/>
91
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementBase"/>
92
      <mapping class="eu.etaxonomy.cdm.model.description.Distribution"/>
93
      <mapping class="eu.etaxonomy.cdm.model.description.Feature"/>
94
      <mapping class="eu.etaxonomy.cdm.model.description.FeatureNode"/>
95
      <mapping class="eu.etaxonomy.cdm.model.description.FeatureTree"/>
96
      <mapping class="eu.etaxonomy.cdm.model.description.KeyStatement"/>
97
      <mapping class="eu.etaxonomy.cdm.model.description.MediaKey"/>
98
      <mapping class="eu.etaxonomy.cdm.model.description.IndividualsAssociation"/>
99
      <mapping class="eu.etaxonomy.cdm.model.description.MeasurementUnit"/>
100
      <mapping class="eu.etaxonomy.cdm.model.description.MultiAccessKey"/>
101
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKey"/>
102
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKeyNode"/>
103
      <mapping class="eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase"/>
104
      <mapping class="eu.etaxonomy.cdm.model.description.PresenceTerm"/>
105
      <mapping class="eu.etaxonomy.cdm.model.description.QuantitativeData"/>
106
      <mapping class="eu.etaxonomy.cdm.model.description.SpecimenDescription"/>
107
      <mapping class="eu.etaxonomy.cdm.model.description.State"/>
108
      <mapping class="eu.etaxonomy.cdm.model.description.StateData"/>
109
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasure"/>
110
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue"/>
111
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonDescription"/>
112
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonInteraction"/>
113
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonNameDescription"/>
114
      <mapping class="eu.etaxonomy.cdm.model.description.TextData"/>
115
      <mapping class="eu.etaxonomy.cdm.model.description.TextFormat"/>
116
      <mapping class="eu.etaxonomy.cdm.model.description.WorkingSet"/>
117
      <!-- Location Package -->
118
      <mapping class="eu.etaxonomy.cdm.model.location.Continent"/>
119
      <mapping class="eu.etaxonomy.cdm.model.location.NamedArea"/>
120
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaLevel"/>
121
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaType"/>
122
      <mapping class="eu.etaxonomy.cdm.model.location.ReferenceSystem"/>
123
      <mapping class="eu.etaxonomy.cdm.model.location.Point"/>
124
      <mapping class="eu.etaxonomy.cdm.model.location.WaterbodyOrCountry"/>
125
      <!-- Media Package -->
126
      <mapping class="eu.etaxonomy.cdm.model.media.AudioFile"/>
127
      <mapping class="eu.etaxonomy.cdm.model.media.ImageFile"/>
128
      <mapping class="eu.etaxonomy.cdm.model.media.Media"/>
129
      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentation"/>
130
      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentationPart"/>
131
      <mapping class="eu.etaxonomy.cdm.model.media.MovieFile"/>
132
      <mapping class="eu.etaxonomy.cdm.model.media.Rights"/>
133
      <mapping class="eu.etaxonomy.cdm.model.media.RightsType"/>
134
      <!-- Molecular Package -->
135
      <mapping class="eu.etaxonomy.cdm.model.molecular.PhylogeneticTree"/>
136
      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaSample"/>
137
      <mapping class="eu.etaxonomy.cdm.model.molecular.Amplification"/>
138
      <mapping class="eu.etaxonomy.cdm.model.molecular.Primer"/>
139
      <mapping class="eu.etaxonomy.cdm.model.molecular.Sequence"/>
140
      <mapping class="eu.etaxonomy.cdm.model.molecular.SequenceString"/>
141
      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleSequence"/>
142
      <mapping class="eu.etaxonomy.cdm.model.molecular.Cloning"/>
143
      <!-- Name Package -->
144
      <mapping class="eu.etaxonomy.cdm.model.name.BacterialName"/>
145
      <mapping class="eu.etaxonomy.cdm.model.name.BotanicalName"/>
146
      <mapping class="eu.etaxonomy.cdm.model.name.CultivarPlantName"/>
147
      <mapping class="eu.etaxonomy.cdm.model.name.HomotypicalGroup"/>
148
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationship"/>
149
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationshipType"/>
150
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationship"/>
151
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationshipType"/>
152
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignation"/>
153
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus"/>
154
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalCode"/>
155
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatus"/>
156
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatusType"/>
157
      <mapping class="eu.etaxonomy.cdm.model.name.NonViralName"/>
158
      <mapping class="eu.etaxonomy.cdm.model.name.Rank"/>
159
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation"/>
160
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus"/>
161
      <mapping class="eu.etaxonomy.cdm.model.name.TaxonNameBase"/>
162
      <mapping class="eu.etaxonomy.cdm.model.name.TypeDesignationBase"/>
163
      <mapping class="eu.etaxonomy.cdm.model.name.ViralName"/>
164
      <mapping class="eu.etaxonomy.cdm.model.name.ZoologicalName"/>
165
      <!-- Occurence Package -->
166
      <mapping class="eu.etaxonomy.cdm.model.occurrence.Collection"/>
167
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEvent"/>
168
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEventType"/>
169
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivedUnit"/>
170
      <mapping class="eu.etaxonomy.cdm.model.occurrence.MediaSpecimen"/>
171
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DeterminationEvent"/>
172
      <mapping class="eu.etaxonomy.cdm.model.occurrence.FieldUnit"/>
173
      <mapping class="eu.etaxonomy.cdm.model.occurrence.GatheringEvent"/>
174
      <mapping class="eu.etaxonomy.cdm.model.occurrence.PreservationMethod"/>
175
      <mapping class="eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase"/>
176
      <!-- Reference Package -->
177
      <mapping class="eu.etaxonomy.cdm.model.reference.Reference"/>
178

    
179
      <!-- Taxon Package -->
180
      <mapping class="eu.etaxonomy.cdm.model.taxon.Synonym"/>
181
      <mapping class="eu.etaxonomy.cdm.model.taxon.SynonymRelationship"/>
182
      <mapping class="eu.etaxonomy.cdm.model.taxon.SynonymRelationshipType"/>
183
      <mapping class="eu.etaxonomy.cdm.model.taxon.Taxon"/>
184
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonBase"/>
185
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNode"/>
186
      <mapping class="eu.etaxonomy.cdm.model.taxon.Classification"/>
187
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationship"/>
188
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType"/>
189
      <!-- View Package -->
190
      <mapping class="eu.etaxonomy.cdm.model.view.View"/>
191
      <mapping class="eu.etaxonomy.cdm.model.view.AuditEvent"/>
192
      
193
      <!-- for filling caches -->
194
      <!-- since hibernate 4 listeners are not handled via hibernate.cfg.xml anymore -->
195
      <!--  http://stackoverflow.com/questions/8616146/eventlisteners-using-hibernate-4-0-with-spring-3-1-0-release
196
            https://community.jboss.org/wiki/HibernateCoreMigrationGuide40 -->
197
<!--           <event type="save-update"> -->
198
<!--                      <listener class="eu.etaxonomy.cdm.persistence.hibernate.CacheStrategyGenerator"/> -->
199
<!--                      <listener class="org.hibernate.event.def.DefaultSaveOrUpdateEventListener"/> -->
200
<!--                      <listener class="eu.etaxonomy.cdm.persistence.hibernate.SaveOrUpdateEntityListener"/> -->
201
<!--       </event> -->
202
<!--       <event type="save"> -->
203
<!--           <listener class="eu.etaxonomy.cdm.persistence.hibernate.CacheStrategyGenerator"/> -->
204
<!--                <listener class="eu.etaxonomy.cdm.persistence.hibernate.SaveEntityListener"/> -->
205
<!--           <listener class="org.hibernate.event.def.DefaultSaveEventListener"/> -->
206
<!--       </event> -->
207
<!--       <event type="update"> -->
208
<!--           <listener class="eu.etaxonomy.cdm.persistence.hibernate.CacheStrategyGenerator"/> -->
209
<!--                <listener class="eu.etaxonomy.cdm.persistence.hibernate.UpdateEntityListener"/> -->
210
<!--           <listener class="org.hibernate.event.def.DefaultUpdateEventListener"/> -->
211
<!--       </event> -->
212
<!--       <event type="delete"> -->
213
<!--                       <listener class="eu.etaxonomy.cdm.persistence.hibernate.CdmDeleteListener"/> -->
214
<!--                       <listener class="org.hibernate.event.def.DefaultDeleteEventListener"/> -->
215
<!--       </event> -->
216
<!--       <event type="post-insert"> -->
217
<!--             <listener class="org.hibernate.envers.event.AuditEventListener"/> -->
218
<!--             <listener class="eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener"/> -->
219
<!--         </event> -->
220
<!--         <event type="post-load"> -->
221
<!--             <listener class="eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener"/> -->
222
<!--         </event> -->
223
<!--         <event type="post-update"> -->
224
<!--             <listener class="org.hibernate.envers.event.AuditEventListener"/> -->
225
<!--             <listener class="eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener"/> -->
226
<!--         </event> -->
227
<!--         <event type="post-delete"> -->
228
<!--             <listener class="org.hibernate.envers.event.AuditEventListener"/> -->
229
<!--             <listener class="eu.etaxonomy.cdm.persistence.hibernate.CdmPostDataChangeObservableListener"/> -->
230
<!--         </event> -->
231
<!--         <event type="pre-collection-update"> -->
232
<!--             <listener class="org.hibernate.envers.event.AuditEventListener"/> -->
233
<!--         </event> -->
234
<!--         <event type="pre-collection-remove"> -->
235
<!--             <listener class="org.hibernate.envers.event.AuditEventListener"/> -->
236
<!--         </event> -->
237
<!--         <event type="post-collection-recreate"> -->
238
<!--             <listener class="org.hibernate.envers.event.AuditEventListener"/> -->
239
<!--         </event> -->
240
    </session-factory>
241
</hibernate-configuration>
Add picture from clipboard (Maximum size: 40 MB)