@Entity @Table(name = "OR_ORD") public class Order implements java.io.Serializable {
private Set<OrderLineItem> lineItems;
}
@Entity @Table(name = "OR_LTM") public class OrderLineItem implements java.io.Serializable { }
We have below properties from above class/DB objects that are responsible to composite primary key for another table TR_LTM_RTL_TRN Column name Table name Part of primary key ---------------- ------------- --------------------- DC_DY_BSN OR_ORD part of primary key ID_STR_RT OR_ORD not a part of primary key\just as column AI_TRN OR_LTM not a part of primary key \ just as column ID_WS OR_LTM not a part of primary key\just as column AI_LN_ITM OR_LTM part of primary key
We are calling below code
dao.update(order);
Its a plane JPA update, then there we are receiving exception. I tried to avoid update TR_LTM_RTL_TRN with below code : @EmbeddedId @AttributeOverrides({ @AttributeOverride(name = "retailStoreId", column = @Column(name = "ID_STR_RT", unique = false, nullable = false, insertable = false, updatable = false, length = 5)), @AttributeOverride(name = "workstationId", column = @Column(name = "ID_WS", unique = false, nullable = false, insertable = false, updatable = false, length = 3)), @AttributeOverride(name = "businessDay", column = @Column(name = "DC_DY_BSN", unique = false, nullable = false, insertable = false, updatable = false, length = 10)), @AttributeOverride(name = "transactionSequenceNumber", column = @Column(name = "AI_TRN", unique = false, nullable = false, insertable = false, updatable = false, precision = 0)), @AttributeOverride(name = "retailTransactionLineItemSequenceNumber", column = @Column(name = "AI_LN_ITM", unique = false, nullable = false, insertable = false, updatable = false, precision = 0)) }) public RetailTransactionLineItemId getId() { return this.id; }
However It does not work and still we are getting. Invlaid index column
|