2016-07-15

When I try to add into TDEPOFAZLA table, I get the following error:

org.springframework.dao.DataIntegrityViolationException: could not insert: [tr.gov.tcmb.pgmtems.model.DepoFazla]; SQL [insert into PGMTEMS.TDEPOFAZLA (ID, FAZLABULUNDURMAORANI, GRUP) values (default, ?, ?)]; constraint [null]; nested exception is org.hibernate.exception.ConstraintViolationException: could not insert: [tr.gov.tcmb.pgmtems.model.DepoFazla]

Here is my JUnit test function:

Here is my DepoFazla.java:

Here is DepoTur.java:

When I debug the JUnit test, I get this error:

Error: DB2 SQL Error: SQLCODE=-407, SQLSTATE=23502, SQLERRMC=TBSPACEID=2, TABLEID=75, COLNO=2, DRIVER=3.50.152 SQLState: 23502 ErrorCode: -407

When I search the error, I find that I try to insert NULL but I can't figure out where I add null value.

This is how I create TDEPOFAZLA table:

This is how I create TDEPOTUR table:

Any ideas on what I should do?

Show more