ORMLite + SQLite boolean problem !!

371 views
Skip to first unread message

Robinson Mesino

unread,
Mar 10, 2013, 10:52:25 PM3/10/13
to ormlit...@googlegroups.com

Hi guys,
I'm using ormlite 4.43 and sqlite, i have this problem:
QueryBuilder queryBuilder = XXXXDAO.getXXXXDao().queryBuilder();
queryBuilder.where().eq("_default", true);
ormlite take true as 1 and generate the next SQL:
21:30:28,055 DEBUG StatementExecutor:21 - query of 'SELECT * FROM xxxxWHERE _default = 1 ' returned 0 results

How can fix it ?

Thanks and sorry for my english. :P

Paul Morris

unread,
Jun 28, 2013, 11:58:31 PM6/28/13
to ormlit...@googlegroups.com
Not sure what needs to be 'fixed'. SQLite has no boolean (bit) data type so generally 0 is false and 1 is true (you could add a check constraint to a column in sqlite to only allow 0 or 1). I guess to troubleshoot your problem, you need to start with answering the question 'what are you storing in your column to represent true?'
Reply all
Reply to author
Forward
0 new messages