У меня есть сценарий использования в JPA, где мне нужно увеличить количество или обновить существующую строку количеством при повторной вставке первичного ключа.
@Table(name = "order_line_exception")
@IdClass(OrderLineExceptionKey.class)
public class OrderLineException
@Id
@Column(name = "order_id")
private long orderId;
@Id
@Column(name = "gtin_nbr")
private String gtinNbr;
@Id
@Column(name = "order_line_nbr")
private short orderLineNbr;
@Id
@Column(name = "exception_code")
private short exceptionCode;
@Column(name = "exception_qty")
private int exceptionQty;
}````
increase exceptionQty if same primary key repeated