Timothy, 
       
      Your mappings should use separate join tables. Right now they
      default to use the same PERSON_ACTIVITY table causing the issue. 
       
      Add a @JoinTable specification to say choreList, e.g. 
       
      @JoinTable(name="PERSON_CHORE_ACTIVITY") 
       
      You can then leave hobbyList to use the default PERSON_ACTIVITY or
      specify a join table for it as well. 
       
      Cheers, 
      Guy 
     
    On 27/07/2011 8:20 AM, Timothy Falconer wrote:
    
      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
_______________________________________________
eclipselink-users mailing list
eclipselink-users@xxxxxxxxxxx
https://dev.eclipse.org/mailman/listinfo/eclipselink-users
 
     
  
 |