| Well in the code I tested it worked fine. I guess it makes a difference if you have further subtypes i.e. if Company had other subtypes, then the FK would not be generated. This is the case with your RegularUser apparently since it has subtypes Admins and Editors. Since instances of these subtypes do not have an entry in the table for RegularUser, Hibernate can't add a FK constraint from UserTask to RegularUser. That would be wrong. What you maybe want, is to have SINGLE_TABLE inheritance for subclasses of RegularUser, then there wouldn't be the tables Admins and Editors but a discriminator column would be introduced in the RegularUsers table to distinguish the subtypes. Unfortunately this is not yet possible. For further information see: https://hibernate.atlassian.net/browse/HHH-7181 |