pardom-zz / ActiveAndroid

Active record style SQLite persistence for Android
http://www.activeandroid.com
4.7k stars 1.03k forks source link

getAll() causes my app to crash. How can I fix it? #539

Closed tolgasaglik closed 6 years ago

tolgasaglik commented 6 years ago

List queryItems = new ArrayList<>(getAll(String string)); // Crash point

Function in Item class extends Model:

public static List getAll(String string) { return new Select() .from(Item.class) .where("String = ?") .orderBy("Name ASC") .execute(); }

mgautam099 commented 6 years ago

your where clause contains a question mark but you have not supplied the parameter string, try changing it to: where("String =?",string)

joshuapinter commented 6 years ago

@tolgasaglik Did you try @mgautam099's suggestion and what was the result?