Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
Re: [eclipselink-users] A Join table with additional columns. Eclipselink 2.0.1

Den 24.05.2010 16:26, skrev Christopher Delahunt:
Hello,

Not sure if this is the cause of the exception, but the ZenCategory class is using the OneToMany(mappedBy="category") but also defining a joincolumn which it shouldn't.  The mappedby tells it to use the column defined in the category mapping on the ZenCategoryDescription.

The exception is occuring due to the default column name being used for the ZenCategoryDescription category mapping, but I'm not sure why it wouldn't pick up the PrimaryKeyJoinColumn definition.  If removing the join column annotation on the ZenCategory class doesn't work, try using just a JoinColumn and setting it to be updatable/insertable=false.  If you are able to use JPA2.0 annotations, use the @MapsId(name="categoryId") annotation instead of a joincolumn.

Thank you so much for your response :-)
I just opened up my mail to send a mail that said that I got it working with a little help of Dali. ;-)

Posted the new versions if someone down the line would be remotely interested. Probably put them on www.flinkgutt.net/b/ aswell for posterity. :-)

http://pastebin.com/ZZV7B9kL - ZenCategory
http://pastebin.com/db09sCM9 - ZenLanguage
http://pastebin.com/uM2nRp96 - ZenCategoryDescription
http://pastebin.com/dZ7tYTPn - ZenCategoryDescriptionPK (new name)

--
Regards
Christian Michelsen


Back to the top