I have a table that contains the stock. It’s legacy database and the stock is kept in columns. The database has a constraint on the columns stating that they can’t be negative values. But I only get the constrain violation after the Transaction is committed.
15:21:31,154 WARN JDBCExceptionReporter:77 - SQL Error: 2290, SQLState: 23000
15:21:31,154 ERROR JDBCExceptionReporter:78 - ORA-02290: check constraint (ERPDSS13.STKMAST_CON_QTY13) violated
ORA-06512: at "ERPDSS13.INLTRAN_UPD_STKMAST", line 25
ORA-04088: error during execution of trigger 'ERPDSS13.INLTRAN_UPD_STKMAST'
Is there a way with annotations you can specify that a column can’t be negative. Below is the column mapping?
@Column(name = "STKSOHQTY01", precision = 12)
public BigDecimal getStksohqty01() {
return this.stksohqty01;
}
It should work