I'm writing a hibernate mapper for an existing database, and only need to use a handful of objects from this db.
When I run my test, I keep getting the following error: Foreign key (FK5E0F67F881B2AA8:group [group_code])) must have same number of columns as the referenced primary key (group [ec_env,group_code])
The group.hbm.xml lookslike
The group model object & xdoclet tags looks like:
The composite key of group is a foreign key of two other db objects that I haven't modelled, could this be the issue?
Shailesh Kini
Ranch Hand
Joined: Oct 17, 2001
Posts: 153
posted
0
Hi Alana,
From what I understand you have a composite key as a primary key for your Group Entity. If CcRecepient has a foreign key constraint on Group it has be be on both those keys(group_code and ecEnv). The composite key defines uniqueness in our Group table. I think you cannot just use groupCode but should use the composite key.