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
|
<!-- This is a copy of cdmlib-persistence/src/main/resources/eu/etaxonomy/cdm/hibernate/hibernate.cfg.xml. If the former changes in the mapping part *this* file needs to be changed accordingly.
|
7
|
Difference are to be found in
|
8
|
* <property name="hibernate.implicit_naming_strategy"> which is missing in the original file
|
9
|
* <property name="hibernate.connection.provider_class" which has a different value in the original file
|
10
|
-->
|
11
|
|
12
|
<hibernate-configuration>
|
13
|
<session-factory>
|
14
|
|
15
|
<property name="connection.release_mode">after_transaction</property>
|
16
|
|
17
|
<property name="hibernate.implicit_naming_strategy">org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl</property>
|
18
|
<!-- NOTE: if integrated in spring this is handled there (see persistence.xml) -->
|
19
|
|
20
|
<!-- Connection Pooling -->
|
21
|
<!-- <property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property> -->
|
22
|
<!-- <property name="hibernate.connection.provider_class">org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl</property> -->
|
23
|
<property name="hibernate.connection.provider_class">eu.etaxonomy.cdm.cache.CdmModelCacherConnectionProvider</property>
|
24
|
|
25
|
<!--
|
26
|
Configuring the C3P0ConnectionProvider
|
27
|
========================================
|
28
|
see http://www.mchange.com/projects/c3p0/index.html#hibernate-specific
|
29
|
and also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource)
|
30
|
|
31
|
IMPORTANT:
|
32
|
Because of the constraint (1) the org.hibernate.connection.C3P0ConnectionProvider are not be used
|
33
|
for the Cdm Library because it requires the dataSource bean in some cases.
|
34
|
|
35
|
(1)
|
36
|
Do NOT specify the dataSource in the sessionFactory for example in the
|
37
|
org.springframework.orm.hibernate3.LocalSessionFactoryBean
|
38
|
!!!==> If *dataSource* is set, this will override corresponding settings in Hibernate properties.!!!
|
39
|
If this is set, the Hibernate settings should not define a connection provider to
|
40
|
avoid meaningless double configuration.
|
41
|
(2)
|
42
|
Hibernate uses the hibernate.c3p0.max_size property to determine if c3p0
|
43
|
is beeing used. Therefore the max_size property MUST be set. - maybe not need in hibernate 3.4 +
|
44
|
|
45
|
(3) If you are using Hibernate's C3P0ConnectionProvider you must set the following properties
|
46
|
in your hibernate configuration, using hibernate-specific configuration keys.
|
47
|
All other properties must be defined as usual in a c3p0.properties file.
|
48
|
This is confusing, and will hopefully be simplified some time in the future, but for now...
|
49
|
|
50
|
DOCUMENTATION UPDATE (2015-05-22):
|
51
|
Hibernate's C3P0ConnectionProvider renames 7 c3p0 configuration properties, which,
|
52
|
if set in your hibernate configuration, will override any configuration you may have set
|
53
|
in a c3p0.properties file.
|
54
|
TODO: are points (2) and (3) still valid? I don't think so! (AK)
|
55
|
|
56
|
hibernate.c3p0.acquire_increment
|
57
|
hibernate.c3p0.idle_test_period
|
58
|
hibernate.c3p0.timeout
|
59
|
hibernate.c3p0.max_size
|
60
|
hibernate.c3p0.max_statements
|
61
|
hibernate.c3p0.min_size
|
62
|
hibernate.c3p0.validate
|
63
|
-->
|
64
|
<mapping package="eu.etaxonomy.cdm.model.common"/>
|
65
|
|
66
|
<!-- Agent Package -->
|
67
|
<mapping class="eu.etaxonomy.cdm.model.agent.Address"/>
|
68
|
<mapping class="eu.etaxonomy.cdm.model.agent.Contact"/>
|
69
|
<mapping class="eu.etaxonomy.cdm.model.agent.Institution"/>
|
70
|
<mapping class="eu.etaxonomy.cdm.model.agent.InstitutionalMembership"/>
|
71
|
<mapping class="eu.etaxonomy.cdm.model.agent.Person"/>
|
72
|
<mapping class="eu.etaxonomy.cdm.model.agent.Team"/>
|
73
|
|
74
|
<!-- Common Package -->
|
75
|
<mapping class="eu.etaxonomy.cdm.model.common.Annotation"/>
|
76
|
<mapping class="eu.etaxonomy.cdm.model.common.AnnotationType"/>
|
77
|
<mapping class="eu.etaxonomy.cdm.model.common.Credit"/>
|
78
|
<mapping class="eu.etaxonomy.cdm.model.common.Extension"/>
|
79
|
<mapping class="eu.etaxonomy.cdm.model.common.ExtensionType"/>
|
80
|
<mapping class="eu.etaxonomy.cdm.model.common.IdentifiableSource"/>
|
81
|
<mapping class="eu.etaxonomy.cdm.model.common.Identifier"/>
|
82
|
<mapping class="eu.etaxonomy.cdm.model.common.IntextReference"/>
|
83
|
<mapping class="eu.etaxonomy.cdm.model.common.Language"/>
|
84
|
<mapping class="eu.etaxonomy.cdm.model.common.LanguageString"/>
|
85
|
<mapping class="eu.etaxonomy.cdm.model.common.LSID"/>
|
86
|
<mapping class="eu.etaxonomy.cdm.model.common.LSIDAuthority"/>
|
87
|
<mapping class="eu.etaxonomy.cdm.model.common.Marker"/>
|
88
|
<mapping class="eu.etaxonomy.cdm.model.common.MarkerType"/>
|
89
|
|
90
|
<!-- Description Package -->
|
91
|
<mapping class="eu.etaxonomy.cdm.model.description.CategoricalData"/>
|
92
|
<mapping class="eu.etaxonomy.cdm.model.description.Character"/>
|
93
|
<mapping class="eu.etaxonomy.cdm.model.description.CommonTaxonName"/>
|
94
|
<mapping class="eu.etaxonomy.cdm.model.description.DescriptiveDataSet"/>
|
95
|
<mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementSource"/>
|
96
|
<mapping class="eu.etaxonomy.cdm.model.description.Distribution"/>
|
97
|
<mapping class="eu.etaxonomy.cdm.model.description.Feature"/>
|
98
|
<mapping class="eu.etaxonomy.cdm.model.description.FeatureState"/>
|
99
|
<mapping class="eu.etaxonomy.cdm.model.description.IndividualsAssociation"/>
|
100
|
<mapping class="eu.etaxonomy.cdm.model.description.KeyStatement"/>
|
101
|
<mapping class="eu.etaxonomy.cdm.model.description.MediaKey"/>
|
102
|
<mapping class="eu.etaxonomy.cdm.model.description.MeasurementUnit"/>
|
103
|
<mapping class="eu.etaxonomy.cdm.model.description.MultiAccessKey"/>
|
104
|
<mapping class="eu.etaxonomy.cdm.model.description.NaturalLanguageTerm"/>
|
105
|
<mapping class="eu.etaxonomy.cdm.model.description.PolytomousKey"/>
|
106
|
<mapping class="eu.etaxonomy.cdm.model.description.PolytomousKeyNode"/>
|
107
|
<mapping class="eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm"/>
|
108
|
<mapping class="eu.etaxonomy.cdm.model.description.QuantitativeData"/>
|
109
|
<mapping class="eu.etaxonomy.cdm.model.description.SpecimenDescription"/>
|
110
|
<mapping class="eu.etaxonomy.cdm.model.description.State"/>
|
111
|
<mapping class="eu.etaxonomy.cdm.model.description.StateData"/>
|
112
|
<mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasure"/>
|
113
|
<mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue"/>
|
114
|
<mapping class="eu.etaxonomy.cdm.model.description.TaxonDescription"/>
|
115
|
<mapping class="eu.etaxonomy.cdm.model.description.TaxonInteraction"/>
|
116
|
<mapping class="eu.etaxonomy.cdm.model.description.TaxonNameDescription"/>
|
117
|
<mapping class="eu.etaxonomy.cdm.model.description.TemporalData"/>
|
118
|
<mapping class="eu.etaxonomy.cdm.model.description.TextData"/>
|
119
|
<mapping class="eu.etaxonomy.cdm.model.description.TextFormat"/>
|
120
|
|
121
|
<!-- Location Package -->
|
122
|
<mapping class="eu.etaxonomy.cdm.model.location.NamedArea"/>
|
123
|
<mapping class="eu.etaxonomy.cdm.model.location.NamedAreaLevel"/>
|
124
|
<mapping class="eu.etaxonomy.cdm.model.location.NamedAreaType"/>
|
125
|
<mapping class="eu.etaxonomy.cdm.model.location.ReferenceSystem"/>
|
126
|
<mapping class="eu.etaxonomy.cdm.model.location.Point"/>
|
127
|
<mapping class="eu.etaxonomy.cdm.model.location.Country"/>
|
128
|
|
129
|
<!-- Media Package -->
|
130
|
<mapping class="eu.etaxonomy.cdm.model.media.AudioFile"/>
|
131
|
<mapping class="eu.etaxonomy.cdm.model.media.ExternalLink"/>
|
132
|
<mapping class="eu.etaxonomy.cdm.model.media.ImageFile"/>
|
133
|
<mapping class="eu.etaxonomy.cdm.model.media.Media"/>
|
134
|
<mapping class="eu.etaxonomy.cdm.model.media.MediaMetaData"/>
|
135
|
<mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentation"/>
|
136
|
<mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentationPart"/>
|
137
|
<mapping class="eu.etaxonomy.cdm.model.media.MovieFile"/>
|
138
|
<mapping class="eu.etaxonomy.cdm.model.media.Rights"/>
|
139
|
<mapping class="eu.etaxonomy.cdm.model.media.RightsType"/>
|
140
|
|
141
|
<!-- Meta Data Package -->
|
142
|
<mapping class="eu.etaxonomy.cdm.model.metadata.CdmMetaData"/>
|
143
|
<mapping class="eu.etaxonomy.cdm.model.metadata.CdmPreference"/>
|
144
|
|
145
|
<!-- Molecular Package -->
|
146
|
<mapping class="eu.etaxonomy.cdm.model.molecular.PhylogeneticTree"/>
|
147
|
<mapping class="eu.etaxonomy.cdm.model.molecular.DnaQuality"/>
|
148
|
<mapping class="eu.etaxonomy.cdm.model.molecular.DnaSample"/>
|
149
|
<mapping class="eu.etaxonomy.cdm.model.molecular.Amplification"/>
|
150
|
<mapping class="eu.etaxonomy.cdm.model.molecular.AmplificationResult"/>
|
151
|
<mapping class="eu.etaxonomy.cdm.model.molecular.Primer"/>
|
152
|
<mapping class="eu.etaxonomy.cdm.model.molecular.Sequence"/>
|
153
|
<mapping class="eu.etaxonomy.cdm.model.molecular.SequenceString"/>
|
154
|
<mapping class="eu.etaxonomy.cdm.model.molecular.SingleRead"/>
|
155
|
<mapping class="eu.etaxonomy.cdm.model.molecular.SingleReadAlignment"/>
|
156
|
<mapping class="eu.etaxonomy.cdm.model.molecular.Cloning"/>
|
157
|
|
158
|
<!-- Name Package -->
|
159
|
<mapping class="eu.etaxonomy.cdm.model.name.HomotypicalGroup"/>
|
160
|
<mapping class="eu.etaxonomy.cdm.model.name.HybridRelationship"/>
|
161
|
<mapping class="eu.etaxonomy.cdm.model.name.HybridRelationshipType"/>
|
162
|
<mapping class="eu.etaxonomy.cdm.model.name.NameRelationship"/>
|
163
|
<mapping class="eu.etaxonomy.cdm.model.name.NameRelationshipType"/>
|
164
|
<mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignation"/>
|
165
|
<mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus"/>
|
166
|
<mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalCode"/>
|
167
|
<mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalSource"/>
|
168
|
<mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatus"/>
|
169
|
<mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatusType"/>
|
170
|
<mapping class="eu.etaxonomy.cdm.model.name.Rank"/>
|
171
|
<mapping class="eu.etaxonomy.cdm.model.name.Registration"/>
|
172
|
<mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation"/>
|
173
|
<mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus"/>
|
174
|
<mapping class="eu.etaxonomy.cdm.model.name.TaxonName"/>
|
175
|
<mapping class="eu.etaxonomy.cdm.model.name.TextualTypeDesignation"/>
|
176
|
|
177
|
<!-- Occurrence Package -->
|
178
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.Collection"/>
|
179
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEvent"/>
|
180
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEventType"/>
|
181
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.DerivedUnit"/>
|
182
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.DeterminationEvent"/>
|
183
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.FieldUnit"/>
|
184
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.GatheringEvent"/>
|
185
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent"/>
|
186
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.MediaSpecimen"/>
|
187
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.OccurrenceStatus"/>
|
188
|
<mapping class="eu.etaxonomy.cdm.model.occurrence.PreservationMethod"/>
|
189
|
|
190
|
<!-- Permission Package -->
|
191
|
<mapping class="eu.etaxonomy.cdm.model.permission.CdmAuthority"/>
|
192
|
<mapping class="eu.etaxonomy.cdm.model.permission.GrantedAuthorityImpl"/>
|
193
|
<mapping class="eu.etaxonomy.cdm.model.permission.Group"/>
|
194
|
<mapping class="eu.etaxonomy.cdm.model.permission.Role"/>
|
195
|
<mapping class="eu.etaxonomy.cdm.model.permission.User"/>
|
196
|
|
197
|
<!-- Reference Package -->
|
198
|
<mapping class="eu.etaxonomy.cdm.model.reference.NamedSource"/>
|
199
|
<mapping class="eu.etaxonomy.cdm.model.reference.Reference"/>
|
200
|
<mapping class="eu.etaxonomy.cdm.model.reference.CdmLinkSource"/>
|
201
|
|
202
|
<!-- Taxon Package -->
|
203
|
<mapping class="eu.etaxonomy.cdm.model.taxon.Classification"/>
|
204
|
<mapping class="eu.etaxonomy.cdm.model.taxon.SecundumSource"/>
|
205
|
<mapping class="eu.etaxonomy.cdm.model.taxon.Synonym"/>
|
206
|
<mapping class="eu.etaxonomy.cdm.model.taxon.SynonymType"/>
|
207
|
<mapping class="eu.etaxonomy.cdm.model.taxon.Taxon"/>
|
208
|
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonomicOperation"/>
|
209
|
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNode"/>
|
210
|
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation"/>
|
211
|
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationship"/>
|
212
|
<mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType"/>
|
213
|
|
214
|
<!-- Term Package -->
|
215
|
<mapping class="eu.etaxonomy.cdm.model.term.DefinedTerm"/>
|
216
|
<mapping class="eu.etaxonomy.cdm.model.term.OrderedTerm"/>
|
217
|
<mapping class="eu.etaxonomy.cdm.model.term.OrderedTermVocabulary"/>
|
218
|
<mapping class="eu.etaxonomy.cdm.model.term.Representation"/>
|
219
|
<mapping class="eu.etaxonomy.cdm.model.term.TermRelationshipType"/>
|
220
|
<mapping class="eu.etaxonomy.cdm.model.term.TermTree"/>
|
221
|
<mapping class="eu.etaxonomy.cdm.model.term.TermGraph"/>
|
222
|
<mapping class="eu.etaxonomy.cdm.model.term.TermNode"/>
|
223
|
<mapping class="eu.etaxonomy.cdm.model.term.TermRelation"/>
|
224
|
<mapping class="eu.etaxonomy.cdm.model.term.TermVocabulary"/>
|
225
|
|
226
|
<!-- Validation Package -->
|
227
|
<mapping class="eu.etaxonomy.cdm.model.validation.EntityValidation"/>
|
228
|
<mapping class="eu.etaxonomy.cdm.model.validation.EntityConstraintViolation"/>
|
229
|
|
230
|
<!-- View Package -->
|
231
|
<mapping class="eu.etaxonomy.cdm.model.view.AuditEvent"/>
|
232
|
|
233
|
</session-factory>
|
234
|
</hibernate-configuration>
|