Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (13 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
      <property name="hibernate.implicit_naming_strategy">org.hibernate.boot.model.naming.ImplicitNamingStrategyComponentPathImpl</property>
12
      <!-- NOTE: if integrated in spring this is handled there (see persistence.xml) -->
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.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl</property> -->
17
          <property name="hibernate.connection.provider_class">eu.etaxonomy.cdm.cache.CdmModelCacherConnectionProvider</property>
18
           
19
            <!--
20
          Configuring the C3P0ConnectionProvider
21
          ========================================
22
          see http://www.mchange.com/projects/c3p0/index.html#hibernate-specific
23
          and also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource)
24

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

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

39
          (3) If you are using Hibernate's C3P0ConnectionProvider you must set the following properties
40
          in your hibernate configuration, using hibernate-specific configuration keys.
41
          All other properties must be defined as usual in a c3p0.properties file.
42
          This is confusing, and will hopefully be simplified some time in the future, but for now...
43
          
44
          DOCUMENTATION UPDATE (2015-05-22):
45
          Hibernate's C3P0ConnectionProvider renames 7 c3p0 configuration properties, which, 
46
          if set in your hibernate configuration, will override any configuration you may have set 
47
          in a c3p0.properties file.
48
          TODO: are points (2) and (3) still valid? I don't think so! (AK)
49

50
            hibernate.c3p0.acquire_increment
51
                        hibernate.c3p0.idle_test_period
52
                        hibernate.c3p0.timeout
53
                        hibernate.c3p0.max_size
54
                        hibernate.c3p0.max_statements
55
                        hibernate.c3p0.min_size
56
                        hibernate.c3p0.validate
57
      -->
58
      <mapping package="eu.etaxonomy.cdm.model.common"/>
59
      <!-- Annotation Package -->
60
      <mapping class="eu.etaxonomy.cdm.model.agent.Address"/>
61
      <mapping class="eu.etaxonomy.cdm.model.agent.AgentBase"/>
62
      <mapping class="eu.etaxonomy.cdm.model.agent.Contact"/>
63
      <mapping class="eu.etaxonomy.cdm.model.agent.Institution"/>
64
      <mapping class="eu.etaxonomy.cdm.model.agent.InstitutionalMembership"/>
65
      <mapping class="eu.etaxonomy.cdm.model.agent.Person"/>
66
      <mapping class="eu.etaxonomy.cdm.model.agent.Team"/>
67
      <mapping class="eu.etaxonomy.cdm.model.agent.TeamOrPersonBase"/>
68
      <!-- Common Package -->
69
      <mapping class="eu.etaxonomy.cdm.model.common.Annotation"/>
70
      <mapping class="eu.etaxonomy.cdm.model.common.AnnotationType"/>
71
      <mapping class="eu.etaxonomy.cdm.model.common.Credit"/>
72
      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTerm"/>
73
      <mapping class="eu.etaxonomy.cdm.model.common.DefinedTermBase"/>
74
      <mapping class="eu.etaxonomy.cdm.model.common.Extension"/>
75
      <mapping class="eu.etaxonomy.cdm.model.common.ExtensionType"/>
76
      <mapping class="eu.etaxonomy.cdm.model.common.IdentifiableSource"/>
77
      <mapping class="eu.etaxonomy.cdm.model.common.Identifier"/>
78
      <mapping class="eu.etaxonomy.cdm.model.common.IntextReference"/>
79
      <mapping class="eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl"/>
80
      <mapping class="eu.etaxonomy.cdm.model.common.Group"/>
81
      <mapping class="eu.etaxonomy.cdm.model.common.Language"/>
82
      <mapping class="eu.etaxonomy.cdm.model.common.LanguageString"/>
83
      <mapping class="eu.etaxonomy.cdm.model.common.LSID"/>
84
      <mapping class="eu.etaxonomy.cdm.model.common.LSIDAuthority"/>
85
      <mapping class="eu.etaxonomy.cdm.model.common.Marker"/>
86
      <mapping class="eu.etaxonomy.cdm.model.common.MarkerType"/>
87
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTerm"/>
88
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermBase"/>
89
      <mapping class="eu.etaxonomy.cdm.model.common.OrderedTermVocabulary"/>
90
      <mapping class="eu.etaxonomy.cdm.model.common.OriginalSourceBase"/>
91
      <mapping class="eu.etaxonomy.cdm.model.common.RelationshipTermBase"/>
92
      <mapping class="eu.etaxonomy.cdm.model.common.Representation"/>
93
      <mapping class="eu.etaxonomy.cdm.model.common.TermVocabulary"/>
94
      <mapping class="eu.etaxonomy.cdm.model.common.User"/>
95
      <!-- Description Package -->
96
      <mapping class="eu.etaxonomy.cdm.model.description.CategoricalData"/>
97
      <mapping class="eu.etaxonomy.cdm.model.description.CommonTaxonName"/>
98
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionBase"/>
99
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementBase"/>
100
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementSource"/>
101
      <mapping class="eu.etaxonomy.cdm.model.description.Distribution"/>
102
      <mapping class="eu.etaxonomy.cdm.model.description.Feature"/>
103
      <mapping class="eu.etaxonomy.cdm.model.description.Character"/>
104
      <mapping class="eu.etaxonomy.cdm.model.description.FeatureNode"/>
105
      <mapping class="eu.etaxonomy.cdm.model.description.FeatureTree"/>
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
      <!-- Location Package -->
127
      <mapping class="eu.etaxonomy.cdm.model.location.NamedArea"/>
128
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaLevel"/>
129
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaType"/>
130
      <mapping class="eu.etaxonomy.cdm.model.location.ReferenceSystem"/>
131
      <mapping class="eu.etaxonomy.cdm.model.location.Point"/>
132
      <mapping class="eu.etaxonomy.cdm.model.location.Country"/>
133
      <!-- Media Package -->
134
      <mapping class="eu.etaxonomy.cdm.model.media.AudioFile"/>
135
      <mapping class="eu.etaxonomy.cdm.model.media.ImageFile"/>
136
      <mapping class="eu.etaxonomy.cdm.model.media.Media"/>
137
      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentation"/>
138
      <mapping class="eu.etaxonomy.cdm.model.media.MediaRepresentationPart"/>
139
      <mapping class="eu.etaxonomy.cdm.model.media.MovieFile"/>
140
      <mapping class="eu.etaxonomy.cdm.model.media.Rights"/>
141
      <mapping class="eu.etaxonomy.cdm.model.media.RightsType"/>
142
      <!-- Meta Data Package -->
143
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmMetaData"/>
144
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmPreference"/>
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
      <!-- Name Package -->
158
      <mapping class="eu.etaxonomy.cdm.model.name.HomotypicalGroup"/>
159
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationship"/>
160
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationshipType"/>
161
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationship"/>
162
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationshipType"/>
163
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignation"/>
164
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus"/>
165
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalCode"/>
166
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatus"/>
167
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatusType"/>
168
      <mapping class="eu.etaxonomy.cdm.model.name.Rank"/>
169
      <mapping class="eu.etaxonomy.cdm.model.name.Registration"/>
170
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation"/>
171
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus"/>
172
      <mapping class="eu.etaxonomy.cdm.model.name.TaxonName"/>
173
      <mapping class="eu.etaxonomy.cdm.model.name.TypeDesignationBase"/>
174
      
175
      <!-- Occurrence Package -->
176
      <mapping class="eu.etaxonomy.cdm.model.occurrence.Collection"/>
177
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEvent"/>
178
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEventType"/>
179
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivedUnit"/>
180
      <mapping class="eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent"/>
181
      <mapping class="eu.etaxonomy.cdm.model.occurrence.MediaSpecimen"/>
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.PreservationMethod"/>
186
      <mapping class="eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase"/>
187
      <!-- Reference Package -->
188
      <mapping class="eu.etaxonomy.cdm.model.reference.Reference"/>
189

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

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