Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (13.5 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
      <!-- Annotation Package -->
66
      <mapping class="eu.etaxonomy.cdm.model.agent.Address"/>
67
      <mapping class="eu.etaxonomy.cdm.model.agent.AgentBase"/>
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
      <mapping class="eu.etaxonomy.cdm.model.agent.TeamOrPersonBase"/>
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.DefinedTerm"/>
79
      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTermBase"/>
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.common.OrderedTerm"/>
94
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermBase"/>
95
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermVocabulary"/>
96
      <mapping class="eu.etaxonomy.cdm.model.common.OriginalSourceBase"/>
97
      <mapping class="eu.etaxonomy.cdm.model.common.RelationshipTermBase"/>
98
      <mapping class="eu.etaxonomy.cdm.model.common.Representation"/>
99
      <mapping class="eu.etaxonomy.cdm.model.common.TermVocabulary"/>
100
      <mapping class="eu.etaxonomy.cdm.model.common.User"/>
101
      <!-- Description Package -->
102
      <mapping class="eu.etaxonomy.cdm.model.description.CategoricalData"/>
103
      <mapping class="eu.etaxonomy.cdm.model.description.CommonTaxonName"/>
104
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionBase"/>
105
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementBase"/>
106
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementSource"/>
107
      <mapping class="eu.etaxonomy.cdm.model.description.Distribution"/>
108
      <mapping class="eu.etaxonomy.cdm.model.description.Feature"/>
109
      <mapping class="eu.etaxonomy.cdm.model.description.Character"/>
110
      <mapping class="eu.etaxonomy.cdm.model.description.FeatureNode"/>
111
      <mapping class="eu.etaxonomy.cdm.model.description.FeatureTree"/>
112
      <mapping class="eu.etaxonomy.cdm.model.description.KeyStatement"/>
113
      <mapping class="eu.etaxonomy.cdm.model.description.MediaKey"/>
114
      <mapping class="eu.etaxonomy.cdm.model.description.IndividualsAssociation"/>
115
      <mapping class="eu.etaxonomy.cdm.model.description.MeasurementUnit"/>
116
      <mapping class="eu.etaxonomy.cdm.model.description.MultiAccessKey"/>
117
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKey"/>
118
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKeyNode"/>
119
      <mapping class="eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm"/>
120
      <mapping class="eu.etaxonomy.cdm.model.description.QuantitativeData"/>
121
      <mapping class="eu.etaxonomy.cdm.model.description.SpecimenDescription"/>
122
      <mapping class="eu.etaxonomy.cdm.model.description.State"/>
123
      <mapping class="eu.etaxonomy.cdm.model.description.StateData"/>
124
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasure"/>
125
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue"/>
126
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonDescription"/>
127
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonInteraction"/>
128
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonNameDescription"/>
129
      <mapping class="eu.etaxonomy.cdm.model.description.TextData"/>
130
      <mapping class="eu.etaxonomy.cdm.model.description.TextFormat"/>
131
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptiveDataSet"/>
132
      <!-- Location Package -->
133
      <mapping class="eu.etaxonomy.cdm.model.location.NamedArea"/>
134
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaLevel"/>
135
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaType"/>
136
      <mapping class="eu.etaxonomy.cdm.model.location.ReferenceSystem"/>
137
      <mapping class="eu.etaxonomy.cdm.model.location.Point"/>
138
      <mapping class="eu.etaxonomy.cdm.model.location.Country"/>
139
      <!-- Media Package -->
140
      <mapping class="eu.etaxonomy.cdm.model.media.AudioFile"/>
141
      <mapping class="eu.etaxonomy.cdm.model.media.ExternalLink"/>
142
      <mapping class="eu.etaxonomy.cdm.model.media.ImageFile"/>
143
      <mapping class="eu.etaxonomy.cdm.model.media.Media"/>
144
      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentation"/>
145
      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentationPart"/>
146
      <mapping class="eu.etaxonomy.cdm.model.media.MovieFile"/>
147
      <mapping class="eu.etaxonomy.cdm.model.media.Rights"/>
148
      <mapping class="eu.etaxonomy.cdm.model.media.RightsType"/>
149
      <!-- Meta Data Package -->
150
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmMetaData"/>
151
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmPreference"/>
152
      <!-- Molecular Package -->
153
      <mapping class="eu.etaxonomy.cdm.model.molecular.PhylogeneticTree"/>
154
      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaQuality"/>
155
      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaSample"/>
156
      <mapping class="eu.etaxonomy.cdm.model.molecular.Amplification"/>
157
      <mapping class="eu.etaxonomy.cdm.model.molecular.AmplificationResult"/>
158
      <mapping class="eu.etaxonomy.cdm.model.molecular.Primer"/>
159
      <mapping class="eu.etaxonomy.cdm.model.molecular.Sequence"/>
160
      <mapping class="eu.etaxonomy.cdm.model.molecular.SequenceString"/>
161
      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleRead"/>
162
      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleReadAlignment"/>
163
      <mapping class="eu.etaxonomy.cdm.model.molecular.Cloning"/>
164
      <!-- Name Package -->
165
      <mapping class="eu.etaxonomy.cdm.model.name.HomotypicalGroup"/>
166
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationship"/>
167
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationshipType"/>
168
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationship"/>
169
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationshipType"/>
170
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignation"/>
171
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus"/>
172
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalCode"/>
173
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatus"/>
174
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatusType"/>
175
      <mapping class="eu.etaxonomy.cdm.model.name.Rank"/>
176
      <mapping class="eu.etaxonomy.cdm.model.name.Registration"/>
177
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation"/>
178
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus"/>
179
      <mapping class="eu.etaxonomy.cdm.model.name.TaxonName"/>
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
      <!-- Reference Package -->
195
      <mapping class="eu.etaxonomy.cdm.model.reference.Reference"/>
196

    
197
      <!-- Taxon Package -->
198
      <mapping class="eu.etaxonomy.cdm.model.taxon.Synonym"/>
199
      <mapping class="eu.etaxonomy.cdm.model.taxon.SynonymType"/>
200
      <mapping class="eu.etaxonomy.cdm.model.taxon.Taxon"/>
201
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonBase"/>
202
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNode"/>
203
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonNodeAgentRelation"/>
204
      <mapping class="eu.etaxonomy.cdm.model.taxon.Classification"/>
205
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationship"/>
206
      <mapping class="eu.etaxonomy.cdm.model.taxon.TaxonRelationshipType"/>
207
      
208
      <!-- Validation Package -->
209
      <mapping class="eu.etaxonomy.cdm.model.validation.EntityValidation"/>
210
      <mapping class="eu.etaxonomy.cdm.model.validation.EntityConstraintViolation"/>
211
      
212
      <!-- View Package -->
213
      <mapping class="eu.etaxonomy.cdm.model.view.AuditEvent"/>
214
      
215
      <!-- for filling caches -->
216
      <!-- since hibernate 4 listeners are not handled via hibernate.cfg.xml anymore -->
217
      <!--  http://stackoverflow.com/questions/8616146/eventlisteners-using-hibernate-4-0-with-spring-3-1-0-release
218
            https://community.jboss.org/wiki/HibernateCoreMigrationGuide40 -->
219

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