Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ActiveAndroid Update() query

I'm trying to make a bulk update to a column using ActiveAndroid. Here's my code:

new Update(SomeModel.class).set("Enabled = 0").execute();

But I'm getting a StackOverflowError. (Edit: My bad, the error was somewhere else). Does anyone know how to execute an Update() query? It doesn't say anything in ActiveAndroid's wiki.

Edit:

This syntax is correct:

new Update(SomeModel.class)
  .set("Enabled = 0")
  .where("Account = ?", account.getId())
  .execute();

You can skip the where if not needed.

like image 493
jlhonora Avatar asked Apr 10 '14 19:04

jlhonora


1 Answers

This syntax is correct:

new Update(SomeModel.class)
  .set("Enabled = 0")
  .where("Account = ?", account.getId())
  .execute();

You can skip the where if not needed.

like image 149
jlhonora Avatar answered Oct 09 '22 04:10

jlhonora