我阅读了有关 orm lite 的所有文档,也在网上查看但没有找到正确的答案。我想执行这个语句:
SELECT * from Drive where day_number=150;
我有代表表的类:
@DatabaseTable(tableName="Drive")
public class Drive{
@DatabaseField(generatedId=true)
private int drive_id;
@DatabaseField
private String start_time;
@DatabaseField
private String end_time;
@DatabaseField
private String price;
@DatabaseField
private String distance;
@DatabaseField
private String day_number;
@DatabaseField
private String week_number;
@DatabaseField
private String month;
getters and setters ...
}
当我运行时:
List<Drive> today = getHelper().getVoznjaDao().queryBuilder().where().
eq("day_number","150").query();
我明白NullPointerExeption
了,这不是因为数据库中没有 150 的记录。请帮助我绝望。