I am using ActiveAndroid as ORM system in my project and i use this line of code for Query over database
List<Chats> s = new Select()
.from(Chats.class)
.where(col_conversation + " = ? and " + col_sender + " = ? and " + col_body + " = ?",conversation.getId(),sender.getId(),body) .execute();
but it fetch 0 row as result. i am sure that i have such row in database.
Another way is to use several where clause to execute multiparameter query:
List<Chats> s = new Select()
.from(Chats.class)
.where(col_conversation + " = ?",conversation.getId())
.where(col_sender + " = ?", sender.getId())
.where(body + " = ?", body)
.execute();
you most pass no parameters and change your select query to below :
List<Chats> s = new Select()
.from(Chats.class)
.where(col_conversation + " = " + conversation.getId() + " and " + col_sender + " = " + sender.getId() + " and " + col_body + " = '" + body + "'")
.execute();
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With