Project

General

Profile

Statistics
| Branch: | Tag: | Revision:

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

History | View | Annotate | Download (13.1 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
      <!-- Connection Pooling -->
12
<!--       <property name="hibernate.connection.provider_class">org.hibernate.service.jdbc.connections.internal.C3P0ConnectionProvider</property> -->
13
      <property name="hibernate.connection.provider_class">org.hibernate.engine.jdbc.connections.internal.DatasourceConnectionProviderImpl</property>
14
            <!--
15
          Configuring the C3P0ConnectionProvider
16
          ========================================
17
          see http://www.mchange.com/projects/c3p0/index.html#hibernate-specific
18
          and also org.springframework.orm.hibernate3.AbstractSessionFactoryBean.setDataSource(DataSource dataSource)
19

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

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

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

45
            hibernate.c3p0.acquire_increment
46
                        hibernate.c3p0.idle_test_period
47
                        hibernate.c3p0.timeout
48
                        hibernate.c3p0.max_size
49
                        hibernate.c3p0.max_statements
50
                        hibernate.c3p0.min_size
51
                        hibernate.c3p0.validate
52
      -->
53
      <mapping package="eu.etaxonomy.cdm.model.common"/>
54
      
55
      <!-- Agent Package -->
56
      <mapping class="eu.etaxonomy.cdm.model.agent.Address"/>
57
      <mapping class="eu.etaxonomy.cdm.model.agent.AgentBase"/>
58
      <mapping class="eu.etaxonomy.cdm.model.agent.Contact"/>
59
      <mapping class="eu.etaxonomy.cdm.model.agent.Institution"/>
60
      <mapping class="eu.etaxonomy.cdm.model.agent.InstitutionalMembership"/>
61
      <mapping class="eu.etaxonomy.cdm.model.agent.Person"/>
62
      <mapping class="eu.etaxonomy.cdm.model.agent.Team"/>
63
      <mapping class="eu.etaxonomy.cdm.model.agent.TeamOrPersonBase"/>
64
      
65
      <!-- Common Package -->
66
      <mapping class="eu.etaxonomy.cdm.model.common.Annotation"/>
67
      <mapping class="eu.etaxonomy.cdm.model.common.AnnotationType"/>
68
      <mapping class="eu.etaxonomy.cdm.model.common.Credit"/>
69
      <mapping class="eu.etaxonomy.cdm.model.common.Extension"/>
70
      <mapping class="eu.etaxonomy.cdm.model.common.ExtensionType"/>
71
      <mapping class="eu.etaxonomy.cdm.model.common.IdentifiableSource"/>
72
      <mapping class="eu.etaxonomy.cdm.model.common.Identifier"/>
73
      <mapping class="eu.etaxonomy.cdm.model.common.IntextReference"/>
74
      <mapping class="eu.etaxonomy.cdm.model.common.GrantedAuthorityImpl"/>
75
      <mapping class="eu.etaxonomy.cdm.model.common.Group"/>
76
      <mapping class="eu.etaxonomy.cdm.model.common.Language"/>
77
      <mapping class="eu.etaxonomy.cdm.model.common.LanguageString"/>
78
      <mapping class="eu.etaxonomy.cdm.model.common.LSID"/>
79
      <mapping class="eu.etaxonomy.cdm.model.common.LSIDAuthority"/>
80
      <mapping class="eu.etaxonomy.cdm.model.common.Marker"/>
81
      <mapping class="eu.etaxonomy.cdm.model.common.MarkerType"/>
82
      <mapping class="eu.etaxonomy.cdm.model.reference.OriginalSourceBase"/>
83
      <mapping class="eu.etaxonomy.cdm.model.common.RelationshipTermBase"/>
84
      <mapping class="eu.etaxonomy.cdm.model.common.User"/>
85
      
86
      <!-- Description Package -->
87
      <mapping class="eu.etaxonomy.cdm.model.description.CategoricalData"/>
88
      <mapping class="eu.etaxonomy.cdm.model.description.CommonTaxonName"/>
89
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionBase"/>
90
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementBase"/>
91
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptionElementSource"/>
92
      <mapping class="eu.etaxonomy.cdm.model.description.Distribution"/>
93
      <mapping class="eu.etaxonomy.cdm.model.description.Feature"/>
94
      <mapping class="eu.etaxonomy.cdm.model.description.Character"/>
95
      <mapping class="eu.etaxonomy.cdm.model.description.KeyStatement"/>
96
      <mapping class="eu.etaxonomy.cdm.model.description.MediaKey"/>
97
      <mapping class="eu.etaxonomy.cdm.model.description.IndividualsAssociation"/>
98
      <mapping class="eu.etaxonomy.cdm.model.description.MeasurementUnit"/>
99
      <mapping class="eu.etaxonomy.cdm.model.description.MultiAccessKey"/>
100
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKey"/>
101
      <mapping class="eu.etaxonomy.cdm.model.description.PolytomousKeyNode"/>
102
      <mapping class="eu.etaxonomy.cdm.model.description.PresenceAbsenceTerm"/>
103
      <mapping class="eu.etaxonomy.cdm.model.description.QuantitativeData"/>
104
      <mapping class="eu.etaxonomy.cdm.model.description.SpecimenDescription"/>
105
      <mapping class="eu.etaxonomy.cdm.model.description.State"/>
106
      <mapping class="eu.etaxonomy.cdm.model.description.StateData"/>
107
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasure"/>
108
      <mapping class="eu.etaxonomy.cdm.model.description.StatisticalMeasurementValue"/>
109
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonDescription"/>
110
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonInteraction"/>
111
      <mapping class="eu.etaxonomy.cdm.model.description.TaxonNameDescription"/>
112
      <mapping class="eu.etaxonomy.cdm.model.description.TextData"/>
113
      <mapping class="eu.etaxonomy.cdm.model.description.TextFormat"/>
114
      <mapping class="eu.etaxonomy.cdm.model.description.DescriptiveDataSet"/>
115
      
116
      <!-- Location Package -->
117
      <mapping class="eu.etaxonomy.cdm.model.location.NamedArea"/>
118
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaLevel"/>
119
      <mapping class="eu.etaxonomy.cdm.model.location.NamedAreaType"/>
120
      <mapping class="eu.etaxonomy.cdm.model.location.ReferenceSystem"/>
121
      <mapping class="eu.etaxonomy.cdm.model.location.Point"/>
122
      <mapping class="eu.etaxonomy.cdm.model.location.Country"/>
123
      
124
      <!-- Media Package -->
125
      <mapping class="eu.etaxonomy.cdm.model.media.AudioFile"/>
126
      <mapping class="eu.etaxonomy.cdm.model.media.ExternalLink"/>
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
      
135
      <!-- Meta Data Package -->
136
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmMetaData"/>
137
      <mapping class="eu.etaxonomy.cdm.model.metadata.CdmPreference"/>
138
      
139
      <!-- Molecular Package -->
140
      <mapping class="eu.etaxonomy.cdm.model.molecular.PhylogeneticTree"/>
141
      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaQuality"/>
142
      <mapping class="eu.etaxonomy.cdm.model.molecular.DnaSample"/>
143
      <mapping class="eu.etaxonomy.cdm.model.molecular.Amplification"/>
144
      <mapping class="eu.etaxonomy.cdm.model.molecular.AmplificationResult"/>
145
      <mapping class="eu.etaxonomy.cdm.model.molecular.Primer"/>
146
      <mapping class="eu.etaxonomy.cdm.model.molecular.Sequence"/>
147
      <mapping class="eu.etaxonomy.cdm.model.molecular.SequenceString"/>
148
      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleRead"/>
149
      <mapping class="eu.etaxonomy.cdm.model.molecular.SingleReadAlignment"/>
150
      <mapping class="eu.etaxonomy.cdm.model.molecular.Cloning"/>
151
      
152
      <!-- Name Package -->
153
      <mapping class="eu.etaxonomy.cdm.model.name.HomotypicalGroup"/>
154
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationship"/>
155
      <mapping class="eu.etaxonomy.cdm.model.name.HybridRelationshipType"/>
156
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationship"/>
157
      <mapping class="eu.etaxonomy.cdm.model.name.NameRelationshipType"/>
158
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignation"/>
159
      <mapping class="eu.etaxonomy.cdm.model.name.NameTypeDesignationStatus"/>
160
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalCode"/>
161
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatus"/>
162
      <mapping class="eu.etaxonomy.cdm.model.name.NomenclaturalStatusType"/>
163
      <mapping class="eu.etaxonomy.cdm.model.name.Rank"/>
164
      <mapping class="eu.etaxonomy.cdm.model.name.Registration"/>
165
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignation"/>
166
      <mapping class="eu.etaxonomy.cdm.model.name.SpecimenTypeDesignationStatus"/>
167
      <mapping class="eu.etaxonomy.cdm.model.name.TaxonName"/>
168
      <mapping class="eu.etaxonomy.cdm.model.name.TextualTypeDesignation"/>
169
      <mapping class="eu.etaxonomy.cdm.model.name.TypeDesignationBase"/>
170
      
171
      
172
      <!-- Occurrence Package -->
173
      <mapping class="eu.etaxonomy.cdm.model.occurrence.Collection"/>
174
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEvent"/>
175
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivationEventType"/>
176
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DerivedUnit"/>
177
      <mapping class="eu.etaxonomy.cdm.model.occurrence.MaterialOrMethodEvent"/>
178
      <mapping class="eu.etaxonomy.cdm.model.occurrence.MediaSpecimen"/>
179
      <mapping class="eu.etaxonomy.cdm.model.occurrence.DeterminationEvent"/>
180
      <mapping class="eu.etaxonomy.cdm.model.occurrence.FieldUnit"/>
181
      <mapping class="eu.etaxonomy.cdm.model.occurrence.GatheringEvent"/>
182
      <mapping class="eu.etaxonomy.cdm.model.occurrence.PreservationMethod"/>
183
      <mapping class="eu.etaxonomy.cdm.model.occurrence.SpecimenOrObservationBase"/>
184
      
185
      <!-- Reference Package -->
186
      <mapping class="eu.etaxonomy.cdm.model.reference.Reference"/>
187

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

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