title: Hibernate JPA 2.0 update only and insert in child tables
body: <p>I am new to Hibernate JPA.....I have one parent table and multiple child tables.I want to insert the record in child tables basing on parent table existence.I do not want to insert any record in parent table.If entry exist in parent table then i want to insert in child table. I tried with insertable and updatable in parent table primary key as false. but it is not working. I am using JPA 2.0 version.Thank you in advance. Please let me know for any other information.</p>
  
  <p>================ Copy-pasted from comments:</p>
  
  <p>Code Sample :</p>
  
  <pre><code>@Entity
  @NamedQuery(name="Custome.findAll", query="SELECT p FROM Customer p") 
  public class Customer extends AbstractObject implements Serializable {
    private static final long serialVersionUID = 1L;
  
    @EmbeddedId
    private CustomerPK pk;
  
   @Temporal(TemporalType.DATE)
   @Column(name="end_dt") 
   private Date endDt; 
  
   @Column(name="desc_txt") 
   private String descTxt; 
  
   //bi-directional many-to-one association to Dependent 
   @OneToMany(mappedBy="customer", cascade=CascadeType.ALL) 
   private List&lt;Dependent&gt; dependents = new ArrayList&lt;&gt;(); 
  }
  </code></pre>
  
  <p>I want to update descTxt in customer table and wan to insert Dependent table . If CustomerPK exist in table then i want to update if not i want to skip updating of record in Customer table and insertion also. currently i am using session.saveorUpdate(object) If record exist it is updating parent record and inserting in child table , But if parent record does not exist then it is inserting parent record and child records which i didn’t want to insert in parent record </p>