Hi Himadri,

Can you try to set deleteAction=ForeignKeyAction.NULL on the foreignkey
which will nullify the local column when the parent row is deleted.

@Entity
public class EntityA {

...
    @ManyToOne(targetEntity=EntityB.class,fetch=FetchType.LAZY)
    @JoinColumn(name="EntityBId", nullable=true)
    @ForeignKey(deleteAction=ForeignKeyAction.NULL)
    private EntityB eb;
}

@Entity
public class EntityB {
...    
   
@OneToMany(targetEntity=EntityA.class,mappedBy="eb",fetch=FetchType.LAZY)
    private Set<EntityA> entityA = new HashSet<EntityA>();
}

Regards,
Ravi.

-- 
View this message in context: 
http://n2.nabble.com/How-to-specifiy-Cascase-None-for-OneToMany-tp4426059p4428164.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to