• Post Reply Bookmark Topic Watch Topic
  • New Topic

How to delete individual entity in @OneToOne without affecting each other?  RSS feed

Gautam Ry
Ranch Hand
Posts: 41
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi there
Can any one explain how to proceed?
Say,there are two entities
Orders------------->Shipments. Relationship is OnetoOne and Uni-directional.

public class Orders implements Serializable {
@Basic(optional = false)
@Column(name = "OrderId")
private String orderId;
@Column(name = "OrderName")
private String orderName;
private Shipments objShipment;

public class Shipments implements Serializable {
@Column(name = "ShpmentId")
private String shpmentId;
@Column(name = "City")
private String city;

In some cases, I need to delete only Order entity but that deletion should not affect the
Shipment entity at all or it may be vice versa. How to Proceed?
I am stuck.

  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!