|
Re: JPA 2 inserting Parent table when trying to update child table field [message #981643 is a reply to message #980458] |
Mon, 12 November 2012 15:29 |
Chris Delahunt Messages: 1389 Registered: July 2009 |
Senior Member |
|
|
You have not shown any of the mappings or inheritance setup from JPA. The table structure you've shown looks like the child table duplicates the parent table, so my guess is you have the mappings in a parent table and no additional fields in the child, but marked the inheritance to use a joined table strategy. Joined table inheritance means a row for the child entity must exist in both parent and child tables, so probably isn't what you want. You might want a table per class strategy, but you will need to override the field names used in the child since they do not match what is mapped in the parent. You might be better avoiding Inheritance, and have the classes treated as separate independent entities with their own mappings.
See http://www.eclipse.org/eclipselink/api/2.0/javax/persistence/AttributeOverride.html
for info on using @AttributeOverride to change the field names used in the child Entity.
[Updated on: Mon, 12 November 2012 16:14] Report message to a moderator
|
|
|
Powered by
FUDForum. Page generated in 0.02806 seconds