title: Issue in JPA Cascade Save with EmbeddedId in child
body: <p>I am having three class. <code>Person</code>,<code>vehicle</code> and a <code>association</code> class to link the person and vehicle</p>
  
  <p><strong>Person</strong></p>
  
  <pre><code>package entity;
  import javax.persistence.EmbeddedId;
  import javax.persistence.Entity;
  import javax.persistence.OneToMany;
  import javax.persistence.Table;
  
  import org.hibernate.annotations.LazyCollection;
  import org.hibernate.annotations.LazyCollectionOption;
  
  @Entity
  @Table(name ="PERSON")
  public class Person {
  @EmbeddedId
  private PKperson pkPerson;
  
  @LazyCollection(LazyCollectionOption.FALSE)
  @OneToMany(cascade=CascadeType.ALL,mappedBy="person")
  private Set&lt;PersonVehAssnVO&gt; personVehAssnVOSet=new HashSet&lt;PersonVehAssnVO&gt;();
  
  //getters &amp; setters
  }
  </code></pre>
  
  <p><strong>PKperson</strong> </p>
  
  <pre><code>import java.io.Serializable;
  import java.util.Date;
  import javax.persistence.Column;
  import javax.persistence.Embeddable;
  
  @Embeddable
  public class PKperson implements Serializable {
  
  @Column(name="NAME", nullable=false)
  private String name;
  
  @Column(name="DOB_DT", nullable=false)
  private Date dobDt;
  }
  </code></pre>
  
  <p><strong>Vehicle</strong></p>
  
  <pre><code>package entity;
  import java.util.Date;
  import java.util.HashSet;
  import java.util.Set;
  import javax.persistence.CascadeType;
  import javax.persistence.Column;
  import javax.persistence.Entity;
  import javax.persistence.GeneratedValue;
  import javax.persistence.GenerationType;
  import javax.persistence.OneToMany;
  import javax.persistence.Id;
  import javax.persistence.SequenceGenerator;
  import javax.persistence.Table;
  
  import org.hibernate.annotations.LazyCollection;
  import org.hibernate.annotations.LazyCollectionOption;
  
  @Entity
  @Table(name ="VEHICLE")
  public class Vehicle {
  @Id
  @Column(name="VEHICLE_ID",unique=true, nullable=false)  
  @GeneratedValue(strategy = GenerationType.SEQUENCE, generator = "seq_name")
  @SequenceGenerator(allocationSize = 1, name = "seq_name", sequenceName = "SEQ_VEHICLE_ID")
  private Long vehicleId;
  
  @LazyCollection(LazyCollectionOption.FALSE)
  @OneToMany(cascade=CascadeType.ALL,mappedBy="vehicle")
  private Set&lt;PersonVehAssnVO&gt; personVehAssnVOSet=new HashSet&lt;PersonVehAssnVO&gt;();
  
  private String vehicleName;
  
  //getters &amp; setters
  }
  </code></pre>
  
  <p><strong>Person Vehicle Association</strong></p>
  
  <pre><code>package entity;
  
  import javax.persistence.EmbeddedId;
  import javax.persistence.Entity;
  import javax.persistence.OneToMany;
  import javax.persistence.Table;
  
  import org.hibernate.annotations.LazyCollection;
  import org.hibernate.annotations.LazyCollectionOption;
  
  @Entity
  @Table(name ="PERSON_VEHICLE_ASSOC")
  public class PersonVehAssnVO {
  @EmbeddedId
  private PKperson pkPerson;
  
  @ManyToOne
  @JoinColumns({ @JoinColumn(name = "pkPerson.name",referencedColumnName ="NAME"),
  @JoinColumn(name = "pkPerson.dobDt",referencedColumnName ="DOB_DT")})
  private Person person;
  
  @ManyToOne
  @JoinColumn(name = "VEHICLE_ID", referencedColumnName = "VEHICLE_ID")
  private Vehicle vehicle;
  
  //getters &amp; setters
  }
  
  
  //**Save Method**
  PKperson pkPerson = new PKperson();
  SimpleDateFormat dtFormat = new SimpleDateFormat("yyyy-MM-dd");
  Date date1 = dtFormat.parse("1984-12-14");
  pkPerson.setName("Magesh");
  pkPerson.setDobDt(date1);
  
  Person person = new Person();
  person.setPKperson(pkPerson);
  
  Vehicle vehicle = new Vehicle();
  vehicle.setName("Honda350");
  
  PersonVehAssnVO perVehAssnVO = new PersonVehAssnVO();
  PersonVehAssnVO.setPKperson(pkPerson);
  PersonVehAssnVO.setVehicle(vehicle);
  
  Set&lt;PersonVehAssnVO&gt;  assocSet = new HashSet&lt;PersonVehAssnVO&gt;();
  assocSet.add(PersonVehAssnVO);
  
  person.setpersonVehAssnVOSet(assocSet);
  vehicle.setpersonVehAssnVOSet(assocSet);
  
  Session session = getHibernateTemplate().getSessionFactory().openSession();
  transaction = session.beginTransaction();
  
  transaction.begin();    
  session.save(person);       
  transaction.commit();
  </code></pre>
  
  <p>//=============================================================</p>
  
  <p>While Executing the above save logic I am getting error ": <code>[entity.PersonVehAssnVO#component[name,dobDt]{dobDt=magesh, dobDt=1984-12-14 00:00:00}]"</code></p>
  
  <p>Show Sql Gives "<code>select personVehAssnVO_.NAME, personVehAssnVO_.DOB_DT, personVehAssnVO_.VEHICLE_ID as vehicle_34 from PERSON_VEHICLE_ASSOC where personVehAssnVO_.NAME=? and personVehAssnVO_.DOB_DT=?</code>"</p>
  
  <p>I want to save <code>Person</code>,<code>Vehicle</code> and <code>association</code> in a single save means <code>CASCADE ALL</code> When I save <code>Person</code>.</p>
  
  <p>Any help appreciated</p>