Reputation: 4320
Can any one help me out to update an entire object with a where condition in ormlite. I know its possible to update a column using where condition but i need to update the full row with one column value in where condition
Upvotes: 0
Views: 549
Reputation: 83018
createOrUpdate method does the same.
From doc it says that
createOrUpdate(T data)
This is a convenience method for creating an item in the database if it does not exist. The id is extracted from the data argument and a query-by-id is made on the database. If a row in the database with the same id exists then all of the columns in the database will be updated from the fields in the data parameter. If the id is null (or 0 or some other default value) or doesn’t exist in the database then the object will be created in the database. This also means that your data item must have an id field defined.
Upvotes: 2