I have 3 tables (MySQL). Invoice, product and JoinTable InvoiceItems.
When I have new Invoice, I select one ore more products from Product table.
I need insert one row in Invoice table and one or more rows in InvoiceItems table. Product table not change.
I geting error that column 'idinvoice' cannot be null. Can somebody help me please please please.
You may see picture of tables relationship below (attachment).
The column "idinvoice" has been declared with the constraint "Not Null" in DB.
And you have given the annotation
"insertable=false" which stops to insert the value into the "idinvoice" column... So, the INSERT Query is constructed with "NULL" value to be inserted into that column...
Due to the "Not Null" constraint, you are getting such error... make it as "insertable=true" or remove that[ by default insertable is true]