-
1. Re: Question @Inheritance
fhh Apr 11, 2007 6:15 PM (in response to pkraemer)Have you developed this application with hibernate.hbm2ddl.auto = update?
If so, you have probably old constraints lying around from the time when you used InheritanceType.JOINED. Either clean them out manually or drop the whole schema and have it recreated.
Regards
Felix -
2. Re: Question @Inheritance
pkraemer Apr 12, 2007 2:59 AM (in response to pkraemer)Thx for your help
Yes I use hibernate.hbm2ddl.auto = update but I did not try to use InheritanceType.JOINED. That was the problem. If I change it, it works fine. -
3. Re: Question @Inheritance
fhh Apr 12, 2007 5:31 AM (in response to pkraemer)Well, do you WANT to use InheritanceType.JOINED?
I suspect the problem is that the constraint required for JOINED inheritance is not dropped when you switch to single table.
Regards
Felix -
4. Re: Question @Inheritance
pkraemer Apr 13, 2007 2:50 AM (in response to pkraemer)Well, I'm new to EJB so now I'm a little bit confused.
Is there any problem to use Inheritance.JOINED?
I think, SINGLETABLE means all attributes in both entity beans are in one database table.
But there is one table for users (parent entity) and one table for registered users (child entity).
When I now try to persist a new RegisteredUser the Id should be generated by parent an mapped as key to registered users table.
In the end I have an entry in users table and in registered users table.