I want to update a record in my SQLite DB. This record is stored in a table with fields described by annotation @DatabaseField(canBeNull = false). Firstly I store a record, I fill all required values and later I try to update it.
I want to update only some values of record. For example:
Order o = new Order();
o.setStatus(OrderStatus.PENDING);
o.setIdOrder(1);
orderDAO.update(order);
I use update method of RuntimeExceptionDao. It constructs full update query with all columns.
For example:
UPDATE `order` SET `idCustomer` = ?, `number` = ?, `orderDate` = ?, `status` = ? WHERE `idOrder` = ?
And it throws me the exception
java.lang.RuntimeException: java.sql.SQLException: Unable to run update stmt on object Order
How can I specify fields for UPDATE query? I want only this query
UPDATE `order` SET `status` = ? WHERE `idOrder` = ?