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
QueryBuilder
uses thewhere()
method andWhere
class to define theWHERE
portions of the query. There iseq
for equals,gt
for greater-than,lt
for less-than,ne
for not-equals, etc.. So, as @BrownKang points out, your query would be something like: