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.
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.
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.
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.