I tried to persist new data with the SQLContainer and did it like this:
DBService dbService = new DBService();
SQLContainer containterAcc = dbService.getContainerAcc();
Object itemId = containterAcc.addItem();
containterAcc.commit();
The problem here is that the ID of the table stays NULL and since there is a primary key constraint the action fails. I thought that the sequence would count the ID as needed, but unfortunately it is not triggered. How can I do this? Unfortunately I couldn’t find something about this in the documentation…
you might want to extend the
TableQuery class (implements QueryDelegate) and give it as a parameter to the SQLContainer you when you create it. The method storeRow is where the save or update happens.