Skip to main content

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index] [List Home]
[eclipselink-users] link table field doesn't have default value

hi all ... hopefully easy question regarding eclipselink ... I have two many-to-many relationships defined in an entity as follows:

Person.hobbyList -> Activity
Person.choreList -> Activity

EclipseLink (from Glassfish 3.1) creates a link table PERSON_ACTIVITY with the fields:
PERSON_ID, hobby_ID, chore_ID

when I try to add a hobby, it gives this error:
java.sql.SQLException: Field 'chore_ID' doesn't have a default value

MySQL does show a default value of NULL

I try removing the choreList and adding hobbies works.  I try removing the hobbyList and adding chores works.
The error only happens when I have two many-to-many's between the same two entities

what am I missing?
--
Timothy Falconer
Immuexa Corporation
http://immuexa.com
+ 1 610 797 3100 x33






Back to the top