SquiDB是Android平台下SQLite数据库的封装层。简化了SQlite数据库的操作,合并了类型安全对象和面向对象SQL语句处理。
示例代码:
long ageCutoff = System.currentTimeMillis() - (DateUtil.YEAR_IN_MILLIS * 18);Query peopleWhoCanVote = Query.select().where(Person.BIRTHDAY.lt(ageCutoff));// This becomes select * from people where people.birthday < ?// where ? is the age cutoff argSquidCursor<Person> voters = dao.query(Person.class, peopleWhoCanVote);
评论