in ORMLite document i can not find any document about this SQL command:
SELECT * FROM table WHERE state <> 1
i can get query where equal by this code:
List<ContactLists> contacts = G.CONTACTLISTSDAO.queryForEq("state","1");
how to change this code to NOT Equal
The ORMLite DAO has a simple
queryForEq(...)method. If you look at the code forqueryForEq(...)you will see that it is just a convenience method for:This means that you can change the where to use
ne(...)instead ofeq(...):To do more complex queries you should RTFM about the
QueryBuilder.The
QueryBuilderuses thewhere()method andWhereclass to define theWHEREportions of the query. There iseqfor equals,gtfor greater-than,ltfor less-than,nefor not-equals, etc.. So, as @BrownKang points out, your query would be something like: