Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

cdmlib / cdmlib-cache / src / main / resources / eu / etaxonomy / cdm / mappings / hibernate.cfg.xml @ 951c829f

History | View | Annotate | Download (13.7 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
<!-- 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 differen 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.AgentBase"/>
69
      <mapping class="eu.etaxonomy.cdm.model.agent.Contact"/>
70
      <mapping class="eu.etaxonomy.cdm.model.agent.Institution"/>
71
      <mapping class="eu.etaxonomy.cdm.model.agent.InstitutionalMembership"/>
72
      <mapping class="eu.etaxonomy.cdm.model.agent.Person"/>
73
      <mapping class="eu.etaxonomy.cdm.model.agent.Team"/>
74
      <mapping class="eu.etaxonomy.cdm.model.agent.TeamOrPersonBase"/>
75
      
76
      <!-- Common Package -->
77
      <mapping class="eu.etaxonomy.cdm.model.common.Annotation"/>
78
      <mapping class="eu.etaxonomy.cdm.model.common.AnnotationType"/>
79
      <mapping class="eu.etaxonomy.cdm.model.common.Credit"/>
80
      <mapping class="eu.etaxonomy.cdm.model.common.Extension"/>
81
      <mapping class="eu.etaxonomy.cdm.model.common.ExtensionType"/>
82
      <mapping class="eu.etaxonomy.cdm.model.common.IdentifiableSource"/>
83
      <mapping class="eu.etaxonomy.cdm.model.common.Identifier"/>
84
      <mapping class="eu.etaxonomy.cdm.model.common.IntextReference"/>
85
      <mapping class="eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl"/>
86
      <mapping class="eu.etaxonomy.cdm.model.common.Group"/>
87
      <mapping class="eu.etaxonomy.cdm.model.common.Language"/>
88
      <mapping class="eu.etaxonomy.cdm.model.common.LanguageString"/>
89
      <mapping class="eu.etaxonomy.cdm.model.common.LSID"/>
90
      <mapping class="eu.etaxonomy.cdm.model.common.LSIDAuthority"/>
91
      <mapping class="eu.etaxonomy.cdm.model.common.Marker"/>
92
      <mapping class="eu.etaxonomy.cdm.model.common.MarkerType"/>
93
      <mapping class="eu.etaxonomy.cdm.model.reference.OriginalSourceBase"/>
94
      <mapping class="eu.etaxonomy.cdm.model.common.RelationshipTermBase"/>
95
      <mapping class="eu.etaxonomy.cdm.model.common.User"/>
96
      
97
      <!-- Description Package -->
98
      <mapping class="eu.etaxonomy.cdm.model.description.CategoricalData"/>
99
      <mapping class="eu.etaxonomy.cdm.model.description.CommonTaxonName"/>
100
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionBase"/>
101
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementBase"/>
102
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementSource"/>
103
      <mapping class="eu.etaxonomy.cdm.model.description.Distribution"/>
104
      <mapping class="eu.etaxonomy.cdm.model.description.Feature"/>
105
      <mapping class="eu.etaxonomy.cdm.model.description.Character"/>
106
      <mapping class="eu.etaxonomy.cdm.model.description.KeyStatement"/>
107
      <mapping class="eu.etaxonomy.cdm.model.description.MediaKey"/>
108
      <mapping class="eu.etaxonomy.cdm.model.description.IndividualsAssociation"/>
109
      <mapping class="eu.etaxonomy.cdm.model.description.MeasurementUnit"/>
110
      <mapping class="eu.etaxonomy.cdm.model.description.MultiAccessKey"/>
111
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKey"/>
112
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKeyNode"/>
113
      <mapping class="eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm"/>
114
      <mapping class="eu.etaxonomy.cdm.model.description.QuantitativeData"/>
115
      <mapping class="eu.etaxonomy.cdm.model.description.SpecimenDescription"/>
116
      <mapping class="eu.etaxonomy.cdm.model.description.State"/>
117
      <mapping class="eu.etaxonomy.cdm.model.description.StateData"/>
118
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasure"/>
119
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue"/>
120
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonDescription"/>
121
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonInteraction"/>
122
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonNameDescription"/>
123
      <mapping class="eu.etaxonomy.cdm.model.description.TextData"/>
124
      <mapping class="eu.etaxonomy.cdm.model.description.TextFormat"/>
125
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptiveDataSet"/>
126
      
127
      <!-- Location Package -->
128
      <mapping class="eu.etaxonomy.cdm.model.location.NamedArea"/>
129
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaLevel"/>
130
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaType"/>
131
      <mapping class="eu.etaxonomy.cdm.model.location.ReferenceSystem"/>
132
      <mapping class="eu.etaxonomy.cdm.model.location.Point"/>
133
      <mapping class="eu.etaxonomy.cdm.model.location.Country"/>
134
      
135
      <!-- Media Package -->
136
      <mapping class="eu.etaxonomy.cdm.model.media.AudioFile"/>
137
      <mapping class="eu.etaxonomy.cdm.model.media.ExternalLink"/>
138
      <mapping class="eu.etaxonomy.cdm.model.media.ImageFile"/>
139
      <mapping class="eu.etaxonomy.cdm.model.media.Media"/>
140
      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentation"/>
141
      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentationPart"/>
142
      <mapping class="eu.etaxonomy.cdm.model.media.MovieFile"/>
143
      <mapping class="eu.etaxonomy.cdm.model.media.Rights"/>
144
      <mapping class="eu.etaxonomy.cdm.model.media.RightsType"/>
145
      
146
      <!-- Meta Data Package -->
147
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmMetaData"/>
148
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmPreference"/>
149
      
150
      <!-- Molecular Package -->
151
      <mapping class="eu.etaxonomy.cdm.model.molecular.PhylogeneticTree"/>
152
      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaQuality"/>
153
      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaSample"/>
154
      <mapping class="eu.etaxonomy.cdm.model.molecular.Amplification"/>
155
      <mapping class="eu.etaxonomy.cdm.model.molecular.AmplificationResult"/>
156
      <mapping class="eu.etaxonomy.cdm.model.molecular.Primer"/>
157
      <mapping class="eu.etaxonomy.cdm.model.molecular.Sequence"/>
158
      <mapping class="eu.etaxonomy.cdm.model.molecular.SequenceString"/>
159
      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleRead"/>
160
      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleReadAlignment"/>
161
      <mapping class="eu.etaxonomy.cdm.model.molecular.Cloning"/>
162
      
163
      <!-- Name Package -->
164
      <mapping class="eu.etaxonomy.cdm.model.name.HomotypicalGroup"/>
165
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationship"/>
166
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationshipType"/>
167
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationship"/>
168
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationshipType"/>
169
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignation"/>
170
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus"/>
171
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalCode"/>
172
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatus"/>
173
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatusType"/>
174
      <mapping class="eu.etaxonomy.cdm.model.name.Rank"/>
175
      <mapping class="eu.etaxonomy.cdm.model.name.Registration"/>
176
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation"/>
177
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus"/>
178
      <mapping class="eu.etaxonomy.cdm.model.name.TaxonName"/>
179
      <mapping class="eu.etaxonomy.cdm.model.name.TextualTypeDesignation"/>
180
      <mapping class="eu.etaxonomy.cdm.model.name.TypeDesignationBase"/>
181
      
182
      <!-- Occurrence Package -->
183
      <mapping class="eu.etaxonomy.cdm.model.occurrence.Collection"/>
184
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEvent"/>
185
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEventType"/>
186
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivedUnit"/>
187
      <mapping class="eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent"/>
188
      <mapping class="eu.etaxonomy.cdm.model.occurrence.MediaSpecimen"/>
189
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DeterminationEvent"/>
190
      <mapping class="eu.etaxonomy.cdm.model.occurrence.FieldUnit"/>
191
      <mapping class="eu.etaxonomy.cdm.model.occurrence.GatheringEvent"/>
192
      <mapping class="eu.etaxonomy.cdm.model.occurrence.PreservationMethod"/>
193
      <mapping class="eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase"/>
194
      
195
      <!-- Reference Package -->
196
      <mapping class="eu.etaxonomy.cdm.model.reference.Reference"/>
197

    
198
      <!-- Taxon Package -->
199
      <mapping class="eu.etaxonomy.cdm.model.taxon.Synonym"/>
200
      <mapping class="eu.etaxonomy.cdm.model.taxon.SynonymType"/>
201
      <mapping class="eu.etaxonomy.cdm.model.taxon.Taxon"/>
202
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonBase"/>
203
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNode"/>
204
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation"/>
205
      <mapping class="eu.etaxonomy.cdm.model.taxon.Classification"/>
206
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationship"/>
207
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType"/>
208
      
209
      <!-- Term Package -->
210
      <mapping class="eu.etaxonomy.cdm.model.term.DefinedTerm"/>
211
      <mapping class="eu.etaxonomy.cdm.model.term.DefinedTermBase"/>
212
      <mapping class="eu.etaxonomy.cdm.model.term.FeatureTree"/>
213
      <mapping class="eu.etaxonomy.cdm.model.term.OrderedTerm"/>
214
      <mapping class="eu.etaxonomy.cdm.model.term.OrderedTermBase"/>
215
      <mapping class="eu.etaxonomy.cdm.model.term.OrderedTermVocabulary"/>
216
      <mapping class="eu.etaxonomy.cdm.model.term.Representation"/>
217
      <mapping class="eu.etaxonomy.cdm.model.term.TermRelationshipType"/>
218
      <mapping class="eu.etaxonomy.cdm.model.term.TermTreeNode"/>
219
      <mapping class="eu.etaxonomy.cdm.model.term.TermVocabulary"/>
220
      
221
      <!-- Validation Package -->
222
      <mapping class="eu.etaxonomy.cdm.model.validation.EntityValidation"/>
223
      <mapping class="eu.etaxonomy.cdm.model.validation.EntityConstraintViolation"/>
224
      
225
      <!-- View Package -->
226
      <mapping class="eu.etaxonomy.cdm.model.view.AuditEvent"/>
227
      
228
      <!-- for filling caches -->
229
      <!-- since hibernate 4 listeners are not handled via hibernate.cfg.xml anymore -->
230
      <!--  http://stackoverflow.com/questions/8616146/eventlisteners-using-hibernate-4-0-with-spring-3-1-0-release
231
            https://community.jboss.org/wiki/HibernateCoreMigrationGuide40 -->
232

    
233
    </session-factory>
234
</hibernate-configuration>
Add picture from clipboard (Maximum size: 40 MB)