Nav*_*p11 3 sql sqlite android activeandroid
我在我的项目中使用ActiveAndroid作为ORM系统,我使用这行代码进行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();
Run Code Online (Sandbox Code Playgroud)
但它获取0行作为结果.我确信我在数据库中有这样的行.
另一种方法是使用几个where子句来执行多参数查询:
List<Chats> s = new Select()
.from(Chats.class)
.where(col_conversation + " = ?",conversation.getId())
.where(col_sender + " = ?", sender.getId())
.where(body + " = ?", body)
.execute();
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
2722 次 |
| 最近记录: |