android - GreenDao select in range with BETWEEN operator -
i use greendao , have entity defined class:
dot { string name; float value; }
and want extract database dots have value in between value - 1 , value + 1. sql query should lik this:
select * dot value between(value-1, value+1)
can same in greendao, maybe:
querybuilder<dot> query = dotdao.querybuilder(); query.where(dotdao.properties.value.between(dotdao.properties.value-1, dotdao.properties.value+1)); list<range> rangelist = query.list();
is possible or have use raw queries?
you can use , operator.
for example:
querybuilder<dot> query = dotdao.querybuilder(); list<range> rangelist = query.where(dotdao.properties.value.ge(value - 1), dotdao.properties.value.le(value + 1)) .list();
Comments
Post a Comment