emmanuel wrote:
Please double check,
I'm 99% certain you have
hibernate.default_catalog=MySchema
hibernate.default_schema=Employee
in you config files
Other problem in a bidirectional relationship, one side has to be mappedBy
1% = I forgot to include the class EmployerEmployee in the hibernate config file :)
mappedBy is not needed because I used generic.
But I ran into what must be regular hibernate usage problem:
So first I used one session to query the object and at a later point used another session to delete. I think I can work this one out, but it is a bit surprising nevertheless.
org.hibernate.HibernateException: Illegal attempt to associate a collection with two open sessions
at org.hibernate.collection.AbstractPersistentCollection.setCurrentSession(AbstractPersistentCollection.java:410)
at org.hibernate.event.def.OnUpdateVisitor.processCollection(OnUpdateVisitor.java:40)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:101)
at org.hibernate.event.def.AbstractVisitor.processValue(AbstractVisitor.java:61)
at org.hibernate.event.def.AbstractVisitor.processEntityPropertyValues(AbstractVisitor.java:55)
at org.hibernate.event.def.AbstractVisitor.process(AbstractVisitor.java:123)
at org.hibernate.event.def.DefaultDeleteEventListener.onDelete(DefaultDeleteEventListener.java:72)
at org.hibernate.impl.SessionImpl.fireDelete(SessionImpl.java:711)
at org.hibernate.impl.SessionImpl.delete(SessionImpl.java:691)