I get this message with hibernate using JPA 4.3.8.Final
Foreign key (FK_mitl23a09gupxss9kb02crjv9:Related [main_version])) must have same number of columns as the referenced primary key (Main [version,aaid])
These are the facts:
Hibernate The problem does not appear when initiating hibernate via Hibernate's owne Session manager.
OpenEJB The problem appears when initiating an embedded container using OpenEJB. The problem disappears with OpenEJB if I remove any entity and its relations.
JBoss/Wildfly The problem does NOT appear when deploying the code into Wildfly (Wildfly contains hibernate 4.3.6.Final) The problem appears in Wildfly if I add a new entity even without any relations.
In both the Wildfly and OpenEJB cases, JPA finds the classes by scanning the classpath.
I am using derived keys, i.e. A has a one-to-many relation with B, then B has a one-to-many to C, so A has pk=(a) and B has pk=(a,b) and C has pk=(a,b,c). There are more relations, but most references A directly or indirectly.
Does anyone have any suggestions? I'm trying to cut away stuff so I can post something reasonable here, but so far removing anything make the issue disappear..
|