Closed bleuf1shi closed 8 years ago
The reason it's failing is that you haven't unset the rowid in the model object, so persist()
is attempting to do an update operation, but failing since it can't find the corresponding rowid anymore. You can unset the rowid after the delete operation by calling contactModelCopy.setId(TableModel.NO_ID)
. Or, you can call createNew()
instead of persist()
, which will force the operation to clear the model id and then perform an insert.
Perfect. Thank You.
I'm using squidb:2.0.3.
I've over simplified the example code from my own:
The delete works, however, the persist that occurs afterwards always fails. Persist in this "after deleting" case will return false.
Any ideas on how I can implement the ability to delete an item from the database and then allow the ability to subsequently re-insert the same object?
Thanks
Here is my ContactSpec: