1 Reply Latest reply on Mar 24, 2006 5:43 PM by Peter Goldstein

    Join Column not populated with id

    Chris Hornsey Newbie

      I need someone to correct my understanding of one-to-many.

      I have a many to one unidirectional relationship between two objects.

      person is the parent and address is the child.

      The id for person is auto generated. person has a list of addresses mapped as ont-to-many with person as the owner.

      I create a new person, then create 2 new addresses and add them to the list.
      Then I call persist on the new person record.

      Jboss creates the person record, and generates the id (the object returned from persist has the id created by the database). Sadly the join column in the address table does not get populated with the id from the person. I would expect JBoss to populate the children (address) records with the id of the parent before persisting them.

      What am I missing here?
      Any references to documentation would be appreciated.

      Is this just me or is this the expected behavior?


      Thanks in advance.