Reputation: 2361
I have a problem with the SQLContainer in Vaadin. commit()
will committ all changes to the database. I only want to commit a single row to the database.
The situation is that I have a TableQuery and a Table where the user can add and remove new Rows. Each row has properties that can not be null. The problem is, if a user adds 2 new rows to the table and deletes one. The SQLContainer tries to commit everything and will throw an exception because 1 item has null values.
Is it possible that I can tell him only to commit the rows I want him to ?
rollback()
would revert all changes. The problem is that the user can remove item that are already in the database or the ones that are only temporary in the memory.
Would it help to create a RowItem
because that one has a commit method ?
Upvotes: 1
Views: 557
Reputation: 1492
You can commit after added evry of new created item by user. It is not optimal solution but it may solve your problem.
Upvotes: 1