title: org.hibernate.PropertyValueException
body: <p>i have these Pojos:</p>
  
  <pre><code>public class ParticipantPojo implements Serializable
  .....
  @OneToMany(mappedBy = "participant", cascade = CascadeType.ALL)
  private Set&lt;ParticipantIdentificationNumberPojo&gt; identificationNumbers;
  </code></pre>
  
  <p>and</p>
  
  <pre><code>public class ParticipantIdentificationNumberPojo implements Serializable
   ......
  @ManyToOne
  @JoinColumn(name = "PARTICIPANT", nullable = false)
  private ParticipantPojo participant;
  </code></pre>
  
  <p>When i want to create a new participant with</p>
  
  <pre><code> ParticipantPojo pojo= new ParticipantPojo ();
   ...
   Set&lt;ParticipantIdentificationNumberPojo&gt; identSet = new HashSet&lt;ParticipantIdentificationNumberPojo&gt;();
   ParticipantIdentificationNumberPojo identInfo= new ParticipantIdentificationNumberPojo();
   identInfo.setType("xyz");
   identInfo.setNumber(12345);
   identSet.add(identInfo);
   pojo.setIdentificationNumbers(identSet);
  </code></pre>
  
  <p>and save it</p>
  
  <pre><code> session.save(pojo);
  </code></pre>
  
  <p>i get the following error:</p>
  
  <pre><code>org.hibernate.PropertyValueException: not-null property references a null or transient value: de.seeburger.marktpartnerdaten.database.pojo.ParticipantIdentificationNumberPojo.participant
  </code></pre>
  
  <p>In a blog i found the solution to set nullable=true at</p>
  
  <pre><code>@JoinColumn(name = "PARTICIPANT", nullable = false)
  </code></pre>
  
  <p>but that is not what i want (participant should not be null!)...setting nullable=true create another exception</p>
  
  <pre><code>org.hibernate.TransientObjectException: object references an unsaved transient instance - save the transient instance before flushing: de.seeburger.marktpartnerdaten.database.pojo.ParticipantPojo
  </code></pre>
  
  <p>I think the problem is, that Hibernate does not save the participant and take the ID to save participantIdentificationNumber...but i found no solution for my exception :-(</p>