[
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4633?page=c...
]
Kevin Schmidt updated HHH-4633:
-------------------------------
Attachment: ChildOfExampleTestClass.java
DuplicateMappingExceptionTestCase.java
ExampleTestClass.java
I have attached the java files needed for the runnable test case. Also below is the log
output for when you run the given test case and the hibernate configuration.
{noformat}
2009-12-02 11:21:12,570 [main] ERROR (DuplicateMappingExceptionTestCase.java:26) Starting
Test by creating configuration.
2009-12-02 11:21:12,595 [main] INFO (Version.java:37) Hibernate Annotations 3.5.0.Beta1
2009-12-02 11:21:12,604 [main] INFO (Environment.java:558) Hibernate 3.5.0-Beta-2
2009-12-02 11:21:12,606 [main] INFO (Environment.java:591) hibernate.properties not
found
2009-12-02 11:21:12,610 [main] INFO (Environment.java:769) Bytecode provider name :
javassist
2009-12-02 11:21:12,612 [main] INFO (Environment.java:650) using JDK 1.4
java.sql.Timestamp handling
2009-12-02 11:21:12,676 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [uuid] -> [class
org.hibernate.id.UUIDHexGenerator]
2009-12-02 11:21:12,678 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [hilo] -> [class
org.hibernate.id.TableHiLoGenerator]
2009-12-02 11:21:12,679 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [assigned] -> [class
org.hibernate.id.Assigned]
2009-12-02 11:21:12,680 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [identity] -> [class
org.hibernate.id.IdentityGenerator]
2009-12-02 11:21:12,680 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [select] -> [class
org.hibernate.id.SelectGenerator]
2009-12-02 11:21:12,681 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [sequence] -> [class
org.hibernate.id.SequenceGenerator]
2009-12-02 11:21:12,682 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [seqhilo] -> [class
org.hibernate.id.SequenceHiLoGenerator]
2009-12-02 11:21:12,683 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [increment] -> [class
org.hibernate.id.IncrementGenerator]
2009-12-02 11:21:12,683 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [foreign] -> [class
org.hibernate.id.ForeignGenerator]
2009-12-02 11:21:12,684 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [guid] -> [class
org.hibernate.id.GUIDGenerator]
2009-12-02 11:21:12,685 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [uuid.hex] -> [class
org.hibernate.id.UUIDHexGenerator]
2009-12-02 11:21:12,686 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [sequence-identity] -> [class
org.hibernate.id.SequenceIdentityGenerator]
2009-12-02 11:21:12,687 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [enhanced-sequence] -> [class
org.hibernate.id.enhanced.SequenceStyleGenerator]
2009-12-02 11:21:12,689 [main] DEBUG (DefaultIdentifierGeneratorFactory.java:99)
Registering IdentifierGenerator strategy [enhanced-table] -> [class
org.hibernate.id.enhanced.TableGenerator]
2009-12-02 11:21:12,695 [main] INFO (Version.java:37) Hibernate Commons Annotations
3.2.0-SNAPSHOT
2009-12-02 11:21:12,699 [main] INFO (Configuration.java:1500) configuring from resource:
/hibernate.cfg.xml
2009-12-02 11:21:12,699 [main] INFO (Configuration.java:1477) Configuration resource:
/hibernate.cfg.xml
2009-12-02 11:21:12,737 [main] DEBUG (DTDEntityResolver.java:64) trying to resolve
system-id [
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd]
2009-12-02 11:21:12,738 [main] DEBUG (DTDEntityResolver.java:66) recognized hibernate
namespace; attempting to resolve on classpath under org/hibernate/
2009-12-02 11:21:12,738 [main] DEBUG (DTDEntityResolver.java:76) located
[
http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd] in classpath
2009-12-02 11:21:12,760 [main] DEBUG (Configuration.java:1461)
hibernate.default_schema=dbo
2009-12-02 11:21:12,760 [main] DEBUG (Configuration.java:1461)
hibernate.dialect=org.hibernate.dialect.SQLServerDialect
2009-12-02 11:21:12,761 [main] DEBUG (Configuration.java:1461)
hibernate.connection.driver_class=net.sourceforge.jtds.jdbc.Driver
2009-12-02 11:21:12,761 [main] DEBUG (Configuration.java:1461)
hibernate.connection.url=jdbc:jtds:sqlserver://XXX/XXX
2009-12-02 11:21:12,761 [main] DEBUG (Configuration.java:1461)
hibernate.connection.username=XXX
2009-12-02 11:21:12,761 [main] DEBUG (Configuration.java:1461)
hibernate.connection.password=XXX
2009-12-02 11:21:12,761 [main] DEBUG (Configuration.java:1461)
hibernate.connection.isolation=2
2009-12-02 11:21:12,761 [main] DEBUG (Configuration.java:1461)
hibernate.connection.release_mode=on_close
2009-12-02 11:21:12,761 [main] DEBUG (Configuration.java:1461)
hibernate.connection.autocommit=true
2009-12-02 11:21:12,762 [main] DEBUG (Configuration.java:1461)
hibernate.transaction.flush_before_completion=false
2009-12-02 11:21:12,762 [main] DEBUG (Configuration.java:1461)
hibernate.transaction.auto_close_session=false
2009-12-02 11:21:12,762 [main] DEBUG (Configuration.java:1461)
hibernate.hbm2ddl.auto=false
2009-12-02 11:21:12,762 [main] DEBUG (Configuration.java:1461) hibernate.show_sql=true
2009-12-02 11:21:12,762 [main] DEBUG (Configuration.java:1461)
hibernate.default_batch_fetch_size=16
2009-12-02 11:21:12,762 [main] DEBUG (Configuration.java:1461)
hibernate.use_sql_comments=true
2009-12-02 11:21:12,762 [main] DEBUG (Configuration.java:1461) hibernate.format_sql=true
2009-12-02 11:21:12,763 [main] DEBUG (Configuration.java:1461)
hibernate.generate_statistics=true
2009-12-02 11:21:12,763 [main] DEBUG (Configuration.java:1461)
hibernate.bytecode.use_reflection_optimizer=false
2009-12-02 11:21:12,763 [main] DEBUG (Configuration.java:1461)
hibernate.current_session_context_class=managed
2009-12-02 11:21:12,763 [main] DEBUG (Configuration.java:1461)
hibernate.cache.use_second_level_cache=false
2009-12-02 11:21:12,763 [main] DEBUG (Configuration.java:1461)
hibernate.jdbc.use_get_generated_keys=true
2009-12-02 11:21:12,764 [main] DEBUG (Configuration.java:1461)
hibernate.jdbc.batch_versioned_data=true
2009-12-02 11:21:12,764 [main] DEBUG (Configuration.java:1461)
hibernate.order_updates=true
2009-12-02 11:21:12,764 [main] DEBUG (Configuration.java:1461)
hibernate.order_inserts=true
2009-12-02 11:21:12,764 [main] DEBUG (Configuration.java:1461)
hibernate.cache.use_structured_entries=false
2009-12-02 11:21:12,765 [main] DEBUG (Configuration.java:1461)
hibernate.mapping.precedence=class,hbm
2009-12-02 11:21:12,765 [main] DEBUG (Configuration.java:1461)
org.hibernate.envers.auditTableSuffix=History
2009-12-02 11:21:12,765 [main] DEBUG (AnnotationConfiguration.java:693) null <-
org.dom4j.tree.DefaultAttribute@26d4f1 [Attribute: name class value
"duplicatemappingbug.ExampleTestClass"]
2009-12-02 11:21:12,771 [main] DEBUG (AnnotationConfiguration.java:693) null <-
org.dom4j.tree.DefaultAttribute@1b16e52 [Attribute: name class value
"duplicatemappingbug.ChildOfExampleTestClass"]
2009-12-02 11:21:12,772 [main] DEBUG (Configuration.java:1726) Event listener:
post-insert=org.hibernate.envers.event.AuditEventListener
2009-12-02 11:21:12,775 [main] DEBUG (Configuration.java:1726) Event listener:
post-update=org.hibernate.envers.event.AuditEventListener
2009-12-02 11:21:12,775 [main] DEBUG (Configuration.java:1726) Event listener:
post-delete=org.hibernate.envers.event.AuditEventListener
2009-12-02 11:21:12,775 [main] INFO (Configuration.java:1615) Configured SessionFactory:
null
, java.vm.name=Java HotSpot(TM) Client VM, hibernate.default_batch_fetch_size=16,
hibernate.cache.use_second_level_cache=false, file.encoding=Cp1252,
java.specification.version=1.6, hibernate.connection.isolation=2,
hibernate.show_sql=true}
2009-12-02 11:21:12,777 [main] DEBUG (AnnotationConfiguration.java:877) Legacy Validator
not present in classpath, ignoring event listener registration
2009-12-02 11:21:12,780 [main] DEBUG (HibernateSearchEventListenerRegister.java:231)
Search not present in classpath, ignoring event listener registration.
2009-12-02 11:21:12,780 [main] INFO (HibernateSearchEventListenerRegister.java:75) Unable
to find org.hibernate.search.event.FullTextIndexEventListener on the classpath. Hibernate
Search is not enabled.
2009-12-02 11:21:12,780 [main] DEBUG (Configuration.java:1358) Preparing to build session
factory with filters : {}
2009-12-02 11:21:12,780 [main] DEBUG (AnnotationConfiguration.java:270) Execute first pass
mapping processing
2009-12-02 11:21:12,841 [main] DEBUG (AnnotationConfiguration.java:586) Process annotated
classes
2009-12-02 11:21:12,844 [main] INFO (AnnotationBinder.java:459) Binding entity from
annotated class: duplicatemappingbug.ExampleTestClass
2009-12-02 11:21:12,858 [main] DEBUG (Ejb3Column.java:187) Binding column DTYPE. Unique
false. Nullable false.
2009-12-02 11:21:12,866 [main] DEBUG (EntityBinder.java:317) Import with entity name
ExampleTestClass
2009-12-02 11:21:12,869 [main] INFO (EntityBinder.java:444) Bind entity
duplicatemappingbug.ExampleTestClass on table ATable
2009-12-02 11:21:12,873 [main] DEBUG (AnnotationBinder.java:1158) Processing
duplicatemappingbug.ExampleTestClass field annotation
2009-12-02 11:21:12,900 [main] DEBUG (AnnotationBinder.java:1270) Processing annotations
of duplicatemappingbug.ExampleTestClass.id
2009-12-02 11:21:12,901 [main] DEBUG (Ejb3Column.java:187) Binding column AnID. Unique
false. Nullable true.
2009-12-02 11:21:12,902 [main] DEBUG (AnnotationBinder.java:1404) id is an id
2009-12-02 11:21:12,904 [main] DEBUG (SimpleValueBinder.java:253) building SimpleValue for
id
2009-12-02 11:21:12,906 [main] DEBUG (PropertyBinder.java:166) Building property id
2009-12-02 11:21:12,909 [main] DEBUG (AnnotationBinder.java:1442) Bind @Id on id
2009-12-02 11:21:12,910 [main] DEBUG (AnnotationBinder.java:1270) Processing annotations
of duplicatemappingbug.ExampleTestClass.childrenOfType1
2009-12-02 11:21:12,911 [main] DEBUG (Ejb3Column.java:187) Binding column AnIDToJoinOn.
Unique false. Nullable true.
2009-12-02 11:21:12,911 [main] DEBUG (Ejb3Column.java:187) Binding column childrenOfType1.
Unique false. Nullable true.
2009-12-02 11:21:12,914 [main] DEBUG (Ejb3Column.java:187) Binding column null. Unique
false. Nullable true.
2009-12-02 11:21:12,923 [main] DEBUG (Ejb3Column.java:187) Binding column element. Unique
false. Nullable true.
2009-12-02 11:21:12,924 [main] DEBUG (Ejb3Column.java:187) Binding column
childrenOfType1_KEY. Unique false. Nullable true.
2009-12-02 11:21:12,924 [main] DEBUG (Ejb3Column.java:187) Binding column
childrenOfType1_KEY. Unique false. Nullable true.
2009-12-02 11:21:12,925 [main] DEBUG (Ejb3Column.java:187) Binding column null. Unique
false. Nullable false.
2009-12-02 11:21:12,925 [main] DEBUG (Ejb3Column.java:187) Binding column null. Unique
false. Nullable false.
2009-12-02 11:21:12,927 [main] DEBUG (CollectionBinder.java:352) Collection role:
duplicatemappingbug.ExampleTestClass.childrenOfType1
2009-12-02 11:21:12,929 [main] DEBUG (PropertyBinder.java:166) Building property
childrenOfType1
2009-12-02 11:21:12,930 [main] DEBUG (AnnotationBinder.java:1270) Processing annotations
of duplicatemappingbug.ExampleTestClass.childrenOfType2
2009-12-02 11:21:12,930 [main] DEBUG (Ejb3Column.java:187) Binding column AnIDToJoinOn.
Unique false. Nullable true.
2009-12-02 11:21:12,930 [main] DEBUG (Ejb3Column.java:187) Binding column childrenOfType2.
Unique false. Nullable true.
2009-12-02 11:21:12,930 [main] DEBUG (Ejb3Column.java:187) Binding column null. Unique
false. Nullable true.
2009-12-02 11:21:12,931 [main] DEBUG (Ejb3Column.java:187) Binding column element. Unique
false. Nullable true.
2009-12-02 11:21:12,931 [main] DEBUG (Ejb3Column.java:187) Binding column
childrenOfType2_KEY. Unique false. Nullable true.
2009-12-02 11:21:12,931 [main] DEBUG (Ejb3Column.java:187) Binding column
childrenOfType2_KEY. Unique false. Nullable true.
2009-12-02 11:21:12,931 [main] DEBUG (Ejb3Column.java:187) Binding column null. Unique
false. Nullable false.
2009-12-02 11:21:12,931 [main] DEBUG (Ejb3Column.java:187) Binding column null. Unique
false. Nullable false.
2009-12-02 11:21:12,931 [main] DEBUG (CollectionBinder.java:352) Collection role:
duplicatemappingbug.ExampleTestClass.childrenOfType2
2009-12-02 11:21:12,931 [main] DEBUG (PropertyBinder.java:166) Building property
childrenOfType2
2009-12-02 11:21:12,931 [main] DEBUG (AnnotationBinder.java:1270) Processing annotations
of duplicatemappingbug.ExampleTestClass.text
2009-12-02 11:21:12,931 [main] DEBUG (Ejb3Column.java:187) Binding column Text. Unique
false. Nullable true.
2009-12-02 11:21:12,932 [main] DEBUG (PropertyBinder.java:145) binding property text with
lazy=false
2009-12-02 11:21:12,932 [main] DEBUG (SimpleValueBinder.java:253) building SimpleValue for
text
2009-12-02 11:21:12,932 [main] DEBUG (PropertyBinder.java:166) Building property text
2009-12-02 11:21:12,933 [main] INFO (AnnotationBinder.java:459) Binding entity from
annotated class: duplicatemappingbug.ChildOfExampleTestClass
2009-12-02 11:21:12,933 [main] DEBUG (Ejb3Column.java:187) Binding column DTYPE. Unique
false. Nullable false.
2009-12-02 11:21:12,933 [main] DEBUG (EntityBinder.java:317) Import with entity name
ChildOfExampleTestClass
2009-12-02 11:21:12,933 [main] INFO (EntityBinder.java:444) Bind entity
duplicatemappingbug.ChildOfExampleTestClass on table BTable
2009-12-02 11:21:12,934 [main] DEBUG (AnnotationBinder.java:1158) Processing
duplicatemappingbug.ChildOfExampleTestClass field annotation
2009-12-02 11:21:12,934 [main] DEBUG (AnnotationBinder.java:1270) Processing annotations
of duplicatemappingbug.ChildOfExampleTestClass.id
2009-12-02 11:21:12,934 [main] DEBUG (Ejb3Column.java:187) Binding column AnID. Unique
false. Nullable true.
2009-12-02 11:21:12,934 [main] DEBUG (AnnotationBinder.java:1404) id is an id
2009-12-02 11:21:12,934 [main] DEBUG (SimpleValueBinder.java:253) building SimpleValue for
id
2009-12-02 11:21:12,936 [main] DEBUG (PropertyBinder.java:166) Building property id
2009-12-02 11:21:12,936 [main] DEBUG (AnnotationBinder.java:1442) Bind @Id on id
2009-12-02 11:21:12,936 [main] DEBUG (AnnotationBinder.java:1270) Processing annotations
of duplicatemappingbug.ChildOfExampleTestClass.text
2009-12-02 11:21:12,936 [main] DEBUG (Ejb3Column.java:187) Binding column Text. Unique
false. Nullable true.
2009-12-02 11:21:12,936 [main] DEBUG (PropertyBinder.java:145) binding property text with
lazy=false
2009-12-02 11:21:12,936 [main] DEBUG (SimpleValueBinder.java:253) building SimpleValue for
text
2009-12-02 11:21:12,936 [main] DEBUG (PropertyBinder.java:166) Building property text
2009-12-02 11:21:12,936 [main] DEBUG (AnnotationConfiguration.java:578) Process hbm files
2009-12-02 11:21:12,936 [main] DEBUG (SimpleValueBinder.java:278) setting SimpleValue
typeName for id
2009-12-02 11:21:12,937 [main] DEBUG (SimpleValueBinder.java:278) setting SimpleValue
typeName for text
2009-12-02 11:21:12,937 [main] DEBUG (SimpleValueBinder.java:278) setting SimpleValue
typeName for id
2009-12-02 11:21:12,937 [main] DEBUG (SimpleValueBinder.java:278) setting SimpleValue
typeName for text
2009-12-02 11:21:12,937 [main] DEBUG (AnnotationConfiguration.java:447) processing fk
mappings (*ToOne and JoinedSubclass)
2009-12-02 11:21:12,938 [main] DEBUG (Configuration.java:1193) processing extends queue
2009-12-02 11:21:12,938 [main] DEBUG (Configuration.java:1197) processing collection
mappings
2009-12-02 11:21:12,938 [main] DEBUG (CollectionSecondPass.java:64) Second pass for
collection: duplicatemappingbug.ExampleTestClass.childrenOfType2
2009-12-02 11:21:12,938 [main] DEBUG (CollectionBinder.java:675) Binding a OneToMany:
duplicatemappingbug.ExampleTestClass.childrenOfType2 through a foreign key
2009-12-02 11:21:12,939 [main] INFO (CollectionBinder.java:702) Mapping collection:
duplicatemappingbug.ExampleTestClass.childrenOfType2 -> BTable
2009-12-02 11:21:12,941 [main] DEBUG (CollectionSecondPass.java:80) Mapped collection key:
AnIDToJoinOn, one-to-many: duplicatemappingbug.ChildOfExampleTestClass
2009-12-02 11:21:12,941 [main] DEBUG (CollectionSecondPass.java:64) Second pass for
collection: duplicatemappingbug.ExampleTestClass.childrenOfType1
2009-12-02 11:21:12,941 [main] DEBUG (CollectionBinder.java:675) Binding a OneToMany:
duplicatemappingbug.ExampleTestClass.childrenOfType1 through a foreign key
2009-12-02 11:21:12,942 [main] INFO (CollectionBinder.java:702) Mapping collection:
duplicatemappingbug.ExampleTestClass.childrenOfType1 -> BTable
2009-12-02 11:21:12,942 [main] DEBUG (CollectionSecondPass.java:80) Mapped collection key:
AnIDToJoinOn, one-to-many: duplicatemappingbug.ChildOfExampleTestClass
2009-12-02 11:21:12,942 [main] DEBUG (Configuration.java:1208) processing native query and
ResultSetMapping mappings
2009-12-02 11:21:12,942 [main] DEBUG (Configuration.java:1216) processing association
property references
2009-12-02 11:21:12,943 [main] DEBUG (Configuration.java:1238) processing foreign key
constraints
2009-12-02 11:21:12,943 [main] DEBUG (Configuration.java:1321) resolving reference to
class: duplicatemappingbug.ExampleTestClass
2009-12-02 11:21:12,943 [main] INFO (AnnotationConfiguration.java:411) Hibernate
Validator not found: ignoring
2009-12-02 11:21:12,980 [main] INFO (DriverManagerConnectionProvider.java:64) Using
Hibernate built-in connection pool (not for production use!)
2009-12-02 11:21:12,980 [main] INFO (DriverManagerConnectionProvider.java:65) Hibernate
connection pool size: 20
2009-12-02 11:21:12,980 [main] INFO (DriverManagerConnectionProvider.java:68) autocommit
mode: true
2009-12-02 11:21:12,980 [main] INFO (DriverManagerConnectionProvider.java:72) JDBC
isolation level: READ_COMMITTED
2009-12-02 11:21:12,983 [main] INFO (DriverManagerConnectionProvider.java:103) using
driver: net.sourceforge.jtds.jdbc.Driver at URL: jdbc:jtds:sqlserver://XXX/XXX
2009-12-02 11:21:12,983 [main] INFO (DriverManagerConnectionProvider.java:106) connection
properties: {user=XXX, password=XXX, autocommit=true, release_mode=on_close}
2009-12-02 11:21:12,984 [main] DEBUG (DriverManagerConnectionProvider.java:132) opening
new JDBC connection
2009-12-02 11:21:15,572 [main] WARN (SettingsFactory.java:137) Could not obtain
connection to query metadata
java.sql.SQLException: Unknown server host name 'XXX'.
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:386)
at net.sourceforge.jtds.jdbc.ConnectionJDBC3.<init>(ConnectionJDBC3.java:50)
at net.sourceforge.jtds.jdbc.Driver.connect(Driver.java:184)
at java.sql.DriverManager.getConnection(Unknown Source)
at java.sql.DriverManager.getConnection(Unknown Source)
at
org.hibernate.connection.DriverManagerConnectionProvider.getConnection(DriverManagerConnectionProvider.java:133)
at org.hibernate.cfg.SettingsFactory.buildSettings(SettingsFactory.java:114)
at org.hibernate.cfg.Configuration.buildSettingsInternal(Configuration.java:2145)
at org.hibernate.cfg.Configuration.buildSettings(Configuration.java:2141)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1365)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:858)
at
duplicatemappingbug.DuplicateMappingExceptionTestCase.main(DuplicateMappingExceptionTestCase.java:28)
Caused by: java.net.UnknownHostException: XXX
at java.net.PlainSocketImpl.connect(Unknown Source)
at java.net.SocksSocketImpl.connect(Unknown Source)
at java.net.Socket.connect(Unknown Source)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(Unknown Source)
at sun.reflect.DelegatingMethodAccessorImpl.invoke(Unknown Source)
at java.lang.reflect.Method.invoke(Unknown Source)
at net.sourceforge.jtds.jdbc.SharedSocket.createSocketForJDBC3(SharedSocket.java:305)
at net.sourceforge.jtds.jdbc.SharedSocket.<init>(SharedSocket.java:255)
at net.sourceforge.jtds.jdbc.ConnectionJDBC2.<init>(ConnectionJDBC2.java:323)
... 11 more
2009-12-02 11:21:15,589 [main] INFO (Dialect.java:223) Using dialect:
org.hibernate.dialect.SQLServerDialect
2009-12-02 11:21:15,596 [main] INFO (TransactionFactoryFactory.java:59) Using default
transaction strategy (direct JDBC transactions)
2009-12-02 11:21:15,597 [main] INFO (TransactionManagerLookupFactory.java:80) No
TransactionManagerLookup configured (in JTA environment, use of read-write or
transactional second-level cache is not recommended)
2009-12-02 11:21:15,597 [main] INFO (SettingsFactory.java:169) Automatic flush during
beforeCompletion(): disabled
2009-12-02 11:21:15,598 [main] INFO (SettingsFactory.java:173) Automatic session close at
end of transaction: disabled
2009-12-02 11:21:15,598 [main] INFO (SettingsFactory.java:188) Scrollable result sets:
disabled
2009-12-02 11:21:15,598 [main] DEBUG (SettingsFactory.java:192) Wrap result sets:
disabled
2009-12-02 11:21:15,598 [main] INFO (SettingsFactory.java:196) JDBC3 getGeneratedKeys():
enabled
2009-12-02 11:21:15,598 [main] INFO (SettingsFactory.java:204) Connection release mode:
on_close
2009-12-02 11:21:15,599 [main] INFO (SettingsFactory.java:222) Default schema: dbo
2009-12-02 11:21:15,599 [main] INFO (SettingsFactory.java:231) Default batch fetch size:
16
2009-12-02 11:21:15,599 [main] INFO (SettingsFactory.java:235) Generate SQL with
comments: enabled
2009-12-02 11:21:15,599 [main] INFO (SettingsFactory.java:239) Order SQL updates by
primary key: enabled
2009-12-02 11:21:15,599 [main] INFO (SettingsFactory.java:243) Order SQL inserts for
batching: enabled
2009-12-02 11:21:15,599 [main] INFO (SettingsFactory.java:410) Query translator:
org.hibernate.hql.ast.ASTQueryTranslatorFactory
2009-12-02 11:21:15,600 [main] INFO (ASTQueryTranslatorFactory.java:47) Using
ASTQueryTranslatorFactory
2009-12-02 11:21:15,600 [main] INFO (SettingsFactory.java:251) Query language
substitutions: {}
2009-12-02 11:21:15,601 [main] INFO (SettingsFactory.java:256) JPA-QL strict compliance:
disabled
2009-12-02 11:21:15,601 [main] INFO (SettingsFactory.java:261) Second-level cache:
disabled
2009-12-02 11:21:15,601 [main] INFO (SettingsFactory.java:265) Query cache: disabled
2009-12-02 11:21:15,601 [main] INFO (SettingsFactory.java:395) Cache region factory :
org.hibernate.cache.impl.NoCachingRegionFactory
2009-12-02 11:21:15,601 [main] INFO (SettingsFactory.java:275) Optimize cache for minimal
puts: disabled
2009-12-02 11:21:15,601 [main] INFO (SettingsFactory.java:284) Structured second-level
cache entries: disabled
2009-12-02 11:21:15,604 [main] INFO (SettingsFactory.java:304) Echoing all SQL to stdout
2009-12-02 11:21:15,605 [main] INFO (SettingsFactory.java:313) Statistics: enabled
2009-12-02 11:21:15,605 [main] INFO (SettingsFactory.java:317) Deleted entity synthetic
identifier rollback: disabled
2009-12-02 11:21:15,605 [main] INFO (SettingsFactory.java:332) Default entity-mode: pojo
2009-12-02 11:21:15,605 [main] INFO (SettingsFactory.java:336) Named query checking :
enabled
2009-12-02 11:21:15,605 [main] INFO (SettingsFactory.java:340) Check Nullability in Core
(should be disabled when Bean Validation is on): enabled
2009-12-02 11:21:15,695 [main] DEBUG (Configuration.java:569) Mapping document:
[#document: null]
2009-12-02 11:21:15,697 [main] DEBUG (Configuration.java:569) Mapping document:
[#document: null]
2009-12-02 11:21:15,699 [main] DEBUG (Configuration.java:569) Mapping document:
[#document: null]
2009-12-02 11:21:15,700 [main] DEBUG (Configuration.java:569) Mapping document:
[#document: null]
2009-12-02 11:21:15,701 [main] DEBUG (Configuration.java:569) Mapping document:
[#document: null]
2009-12-02 11:21:15,702 [main] DEBUG (AnnotationConfiguration.java:270) Execute first pass
mapping processing
2009-12-02 11:21:15,702 [main] DEBUG (AnnotationConfiguration.java:586) Process annotated
classes
2009-12-02 11:21:15,702 [main] DEBUG (AnnotationConfiguration.java:578) Process hbm files
2009-12-02 11:21:15,712 [main] INFO (HbmBinder.java:348) Mapping class:
duplicatemappingbug.ExampleTestClassHistory -> ATableHistory
2009-12-02 11:21:15,716 [main] DEBUG (HbmBinder.java:1322) Mapped property: id -> AnID
2009-12-02 11:21:15,716 [main] DEBUG (HbmBinder.java:1322) Mapped property: REV -> REV
2009-12-02 11:21:15,717 [main] DEBUG (HbmBinder.java:1322) Mapped property: originalId
-> AnID, REV
2009-12-02 11:21:15,717 [main] DEBUG (HbmBinder.java:1322) Mapped property: REVTYPE ->
REVTYPE
2009-12-02 11:21:15,717 [main] DEBUG (HbmBinder.java:1322) Mapped property: text ->
Text
2009-12-02 11:21:15,717 [main] INFO (HbmBinder.java:348) Mapping class:
ExampleTestClass_ChildOfExampleTestClassHistory ->
ExampleTestClass_ChildOfExampleTestClassHistory
2009-12-02 11:21:15,717 [main] DEBUG (HbmBinder.java:1322) Mapped property: REV -> REV
2009-12-02 11:21:15,718 [main] DEBUG (HbmBinder.java:1322) Mapped property:
ExampleTestClass_id -> AnIDToJoinOn
2009-12-02 11:21:15,718 [main] DEBUG (HbmBinder.java:1322) Mapped property:
childrenOfType1_id -> AnID
2009-12-02 11:21:15,718 [main] DEBUG (HbmBinder.java:1322) Mapped property: originalId
-> REV, AnIDToJoinOn, AnID
2009-12-02 11:21:15,718 [main] DEBUG (HbmBinder.java:1322) Mapped property: REVTYPE ->
REVTYPE
2009-12-02 11:21:15,718 [main] INFO (Configuration.java:2397) duplicate import:
ExampleTestClass_ChildOfExampleTestClassHistory ->
ExampleTestClass_ChildOfExampleTestClassHistory
2009-12-02 11:21:15,718 [main] INFO (HbmBinder.java:348) Mapping class:
ExampleTestClass_ChildOfExampleTestClassHistory ->
ExampleTestClass_ChildOfExampleTestClassHistory
2009-12-02 11:21:15,719 [main] DEBUG (HbmBinder.java:1322) Mapped property: REV -> REV
2009-12-02 11:21:15,719 [main] DEBUG (HbmBinder.java:1322) Mapped property:
ExampleTestClass_id -> AnIDToJoinOn
2009-12-02 11:21:15,720 [main] DEBUG (HbmBinder.java:1322) Mapped property:
childrenOfType2_id -> AnID
2009-12-02 11:21:15,720 [main] DEBUG (HbmBinder.java:1322) Mapped property: originalId
-> REV, AnIDToJoinOn, AnID
2009-12-02 11:21:15,720 [main] DEBUG (HbmBinder.java:1322) Mapped property: REVTYPE ->
REVTYPE
2009-12-02 11:21:15,721 [main] ERROR (DuplicateMappingExceptionTestCase.java:30) Unable to
create proper configuration.
org.hibernate.HibernateException: could not init listeners
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:205)
at org.hibernate.cfg.Configuration.getInitializedEventListeners(Configuration.java:1378)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1367)
at
org.hibernate.cfg.AnnotationConfiguration.buildSessionFactory(AnnotationConfiguration.java:858)
at
duplicatemappingbug.DuplicateMappingExceptionTestCase.main(DuplicateMappingExceptionTestCase.java:28)
Caused by: org.hibernate.DuplicateMappingException: Duplicate class/entity mapping
ExampleTestClass_ChildOfExampleTestClassHistory
at org.hibernate.cfg.Configuration$MappingsImpl.addClass(Configuration.java:2389)
at org.hibernate.cfg.HbmBinder.bindRoot(HbmBinder.java:173)
at org.hibernate.cfg.Configuration.add(Configuration.java:756)
at
org.hibernate.cfg.AnnotationConfiguration.processArtifactsOfType(AnnotationConfiguration.java:580)
at
org.hibernate.cfg.AnnotationConfiguration.secondPassCompile(AnnotationConfiguration.java:307)
at org.hibernate.cfg.Configuration.buildMappings(Configuration.java:1188)
at
org.hibernate.envers.configuration.AuditConfiguration.getFor(AuditConfiguration.java:102)
at org.hibernate.envers.event.AuditEventListener.initialize(AuditEventListener.java:259)
at org.hibernate.event.EventListeners$1.processListener(EventListeners.java:198)
at org.hibernate.event.EventListeners.processListeners(EventListeners.java:181)
at org.hibernate.event.EventListeners.initializeListeners(EventListeners.java:194)
... 4 more
{noformat}
{code:xml}
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-configuration PUBLIC
"-//Hibernate/Hibernate Configuration DTD 3.0//EN"
"http://hibernate.sourceforge.net/hibernate-configuration-3.0.dtd">
<hibernate-configuration>
<session-factory>
<property name="hibernate.default_schema">dbo</property>
<property
name="hibernate.dialect">org.hibernate.dialect.SQLServerDialect</property>
<property
name="hibernate.connection.driver_class">net.sourceforge.jtds.jdbc.Driver</property>
<property
name="hibernate.connection.url">jdbc:jtds:sqlserver://XXX/XXX</property>
<property name="hibernate.connection.username">XXX</property>
<property name="hibernate.connection.password">XXX</property>
<property name="hibernate.connection.isolation">2</property>
<property
name="hibernate.connection.release_mode">on_close</property>
<property name="hibernate.connection.autocommit">true</property>
<property
name="hibernate.transaction.flush_before_completion">false</property>
<property
name="hibernate.transaction.auto_close_session">false</property>
<property name="hibernate.hbm2ddl.auto">false</property>
<property name="hibernate.show_sql">true</property>
<property name="hibernate.default_batch_fetch_size">16</property>
<property name="hibernate.use_sql_comments">true</property>
<property name="hibernate.format_sql">true</property>
<property name="hibernate.generate_statistics">true</property>
<property
name="hibernate.bytecode.use_reflection_optimizer">false</property>
<property
name="hibernate.current_session_context_class">managed</property>
<property
name="hibernate.cache.use_second_level_cache">false</property>
<property
name="hibernate.jdbc.use_get_generated_keys">true</property>
<property
name="hibernate.jdbc.batch_versioned_data">true</property>
<property name="hibernate.order_updates">true</property>
<property name="hibernate.order_inserts">true</property>
<property
name="hibernate.cache.use_structured_entries">false</property>
<property
name="hibernate.mapping.precedence">class,hbm</property>
<property
name="org.hibernate.envers.auditTableSuffix">History</property>
<mapping class="duplicatemappingbug.ExampleTestClass"/>
<mapping class="duplicatemappingbug.ChildOfExampleTestClass"/>
<listener type="post-insert"
class="org.hibernate.envers.event.AuditEventListener" />
<listener type="post-update"
class="org.hibernate.envers.event.AuditEventListener" />
<listener type="post-delete"
class="org.hibernate.envers.event.AuditEventListener" />
</session-factory>
</hibernate-configuration>
{code}
Using same table for multiple relations doesn't work
----------------------------------------------------
Key: HHH-4633
URL:
http://opensource.atlassian.com/projects/hibernate/browse/HHH-4633
Project: Hibernate Core
Issue Type: Bug
Components: envers
Reporter: Adam Warski
Assignee: Adam Warski
Fix For: 3.5
Attachments: ChildOfExampleTestClass.java,
DuplicateMappingExceptionTestCase.java, ExampleTestClass.java
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://opensource.atlassian.com/projects/hibernate/secure/Administrators....
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira