Hello,
I work with the actual version of hibernate.
I t´ry to use the secondary table annotation in my entities and have a problem that in some cases hibernate works and in some cases I get an error.
Error:
Code:
11:33:10 [DEBUG] l.SessionFactoryImpl#<init> : Session factory constructed with filter configurations : {}
11:33:10 [DEBUG] l.SessionFactoryImpl#<init> : instantiating session factory with properties: {hibernate.connection.username=rudi, hibernate.connection.password=ratlos, hibernate.connection.url=jdbc:oracle:thin:@thomaspc:1521:td10g, hibernate.connection.internal_logon=NORMAL}
11:33:10 [ERROR] ate.AssertionFailure#<init> : an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)
org.hibernate.AssertionFailure: Table I$SDD_OBJECT_VERSIONS not found
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:461)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:240)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at de.archtech.oracle.designer.generator.application.Main.main(Main.java:66)
11:33:10 [ERROR] tor.application.Main#main : Hibernate configuration failed!
org.hibernate.AssertionFailure: Table I$SDD_OBJECT_VERSIONS not found
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.getTableId(JoinedSubclassEntityPersister.java:461)
at org.hibernate.persister.entity.JoinedSubclassEntityPersister.<init>(JoinedSubclassEntityPersister.java:240)
at org.hibernate.persister.PersisterFactory.createClassPersister(PersisterFactory.java:58)
at org.hibernate.impl.SessionFactoryImpl.<init>(SessionFactoryImpl.java:226)
at org.hibernate.cfg.Configuration.buildSessionFactory(Configuration.java:1218)
at de.archtech.oracle.designer.generator.application.Main.main(Main.java:66)
What I have figured out.
I have tested a bit around found out, that in my case the following rules applay. :-)
1. If I have a MappedSuperclass as parent class and use in the child class the secondary table annotation, it works.
2. If I have a MappedSuperclass and try to use the secondary table annotation in a child class which uses a joined inheritance it will throw the shown runtime error.
I have looked into the unit tests and found, that my case isn't tested, as it seems.
The unit test just use the secondary table annotation and a joined inheritance but without a MappedSuperclass.
Could this be a bug or what I am doing wrong here?
Thanx a lot
Matthias