Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

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
          <property name="show_sql">true</property>
11
                <property name="format_sql">true</property>
12
                <property name="use_sql_comments">true</property>
13

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

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

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

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

42
            hibernate.c3p0.acquire_increment
43
                        hibernate.c3p0.idle_test_period
44
                        hibernate.c3p0.timeout
45
                        hibernate.c3p0.max_size
46
                        hibernate.c3p0.max_statements
47
                        hibernate.c3p0.min_size
48
                        hibernate.c3p0.validate
49
      -->
50
      <mapping package="eu.etaxonomy.cdm.model.common"/>
51
      <!-- Annotation Package -->
52
      <mapping class="eu.etaxonomy.cdm.model.agent.Address"/>
53
      <mapping class="eu.etaxonomy.cdm.model.agent.AgentBase"/>
54
      <mapping class="eu.etaxonomy.cdm.model.agent.Contact"/>
55
      <mapping class="eu.etaxonomy.cdm.model.agent.Institution"/>
56
      <mapping class="eu.etaxonomy.cdm.model.agent.InstitutionalMembership"/>
57
      <mapping class="eu.etaxonomy.cdm.model.agent.Person"/>
58
      <mapping class="eu.etaxonomy.cdm.model.agent.Team"/>
59
      <mapping class="eu.etaxonomy.cdm.model.agent.TeamOrPersonBase"/>
60
      <!-- Common Package -->
61
      <mapping class="eu.etaxonomy.cdm.model.common.Annotation"/>
62
      <mapping class="eu.etaxonomy.cdm.model.common.AnnotationType"/>
63
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmMetaData"/>
64
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmPreference"/>
65
      <mapping class="eu.etaxonomy.cdm.model.common.Credit"/>
66
      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTerm"/>
67
      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTermBase"/>
68
      <mapping class="eu.etaxonomy.cdm.model.common.Extension"/>
69
      <mapping class="eu.etaxonomy.cdm.model.common.ExtensionType"/>
70
      <mapping class="eu.etaxonomy.cdm.model.common.IdentifiableSource"/>
71
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementSource"/>
72
      <mapping class="eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl"/>
73
      <mapping class="eu.etaxonomy.cdm.model.common.Group"/>
74
      <mapping class="eu.etaxonomy.cdm.model.common.Language"/>
75
      <mapping class="eu.etaxonomy.cdm.model.common.LanguageString"/>
76
      <mapping class="eu.etaxonomy.cdm.model.common.LSID"/>
77
      <mapping class="eu.etaxonomy.cdm.model.common.LSIDAuthority"/>
78
      <mapping class="eu.etaxonomy.cdm.model.common.Marker"/>
79
      <mapping class="eu.etaxonomy.cdm.model.common.MarkerType"/>
80
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermBase"/>
81
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermVocabulary"/>
82
      <mapping class="eu.etaxonomy.cdm.model.common.OriginalSourceBase"/>
83
      <mapping class="eu.etaxonomy.cdm.model.common.RelationshipTermBase"/>
84
      <mapping class="eu.etaxonomy.cdm.model.common.Representation"/>
85
      <mapping class="eu.etaxonomy.cdm.model.common.TermVocabulary"/>
86
      <mapping class="eu.etaxonomy.cdm.model.common.User"/>
87
      <!-- Description Package -->
88
      <mapping class="eu.etaxonomy.cdm.model.description.AbsenceTerm"/>
89
      <mapping class="eu.etaxonomy.cdm.model.description.CategoricalData"/>
90
      <mapping class="eu.etaxonomy.cdm.model.description.CommonTaxonName"/>
91
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionBase"/>
92
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementBase"/>
93
      <mapping class="eu.etaxonomy.cdm.model.description.Distribution"/>
94
      <mapping class="eu.etaxonomy.cdm.model.description.Feature"/>
95
      <mapping class="eu.etaxonomy.cdm.model.description.FeatureNode"/>
96
      <mapping class="eu.etaxonomy.cdm.model.description.FeatureTree"/>
97
      <mapping class="eu.etaxonomy.cdm.model.description.KeyStatement"/>
98
      <mapping class="eu.etaxonomy.cdm.model.description.MediaKey"/>
99
      <mapping class="eu.etaxonomy.cdm.model.description.IndividualsAssociation"/>
100
      <mapping class="eu.etaxonomy.cdm.model.description.MeasurementUnit"/>
101
      <mapping class="eu.etaxonomy.cdm.model.description.MultiAccessKey"/>
102
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKey"/>
103
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKeyNode"/>
104
      <mapping class="eu.etaxonomy.cdm.model.description.PresenceAbsenceTermBase"/>
105
      <mapping class="eu.etaxonomy.cdm.model.description.PresenceTerm"/>
106
      <mapping class="eu.etaxonomy.cdm.model.description.QuantitativeData"/>
107
      <mapping class="eu.etaxonomy.cdm.model.description.SpecimenDescription"/>
108
      <mapping class="eu.etaxonomy.cdm.model.description.State"/>
109
      <mapping class="eu.etaxonomy.cdm.model.description.StateData"/>
110
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasure"/>
111
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue"/>
112
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonDescription"/>
113
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonInteraction"/>
114
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonNameDescription"/>
115
      <mapping class="eu.etaxonomy.cdm.model.description.TextData"/>
116
      <mapping class="eu.etaxonomy.cdm.model.description.TextFormat"/>
117
      <mapping class="eu.etaxonomy.cdm.model.description.WorkingSet"/>
118
      <!-- Location Package -->
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.Country"/>
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.SingleRead"/>
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
      <!-- Occurrence 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.MaterialOrMethodEvent"/>
171
      <mapping class="eu.etaxonomy.cdm.model.occurrence.MediaSpecimen"/>
172
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DeterminationEvent"/>
173
      <mapping class="eu.etaxonomy.cdm.model.occurrence.FieldUnit"/>
174
      <mapping class="eu.etaxonomy.cdm.model.occurrence.GatheringEvent"/>
175
      <mapping class="eu.etaxonomy.cdm.model.occurrence.PreservationMethod"/>
176
      <mapping class="eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase"/>
177
      <!-- Reference Package -->
178
      <mapping class="eu.etaxonomy.cdm.model.reference.Reference"/>
179

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