I have been using db4o in my project,i have to search result and
arrange in Descending order according to particular filed. I follow
below code, but am getting null value.
public List<Recipe> getRecipiesByString(String searchValue)
{
List<Recipe> list=null;
Query query=db().query();
query.constrain(Recipe.class);
Constraint constraint=
query.descend("_title").constrain(searchValue).contains();
query.descend("_description").constrain(searchValue).contains().or(constraint);
query.descend("_rating").orderDescending();
list= query.execute();
return list;
}
I have Class Recipe there, "_title" & "_description" are string fields
and "_rating" is double type field.
when i try to do in descending order with the fields "_rating", it has
been giving null value,
and after comment of this line
query.descend("_rating").orderDescending();
then value is coming properly.
what is solution to get result in Desceding order according to
"_rating".
--
You received this message because you are subscribed to the Google
Groups "Android Developers" group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscribe@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en
No comments:
Post a Comment