Friday, July 8, 2011

[android-developers] Re: db4o SODA query giving result null on ordering descending

Hi.

I couldn't reproduce the issue. Which version of db4o are you using?

On Jun 10, 1:41 pm, imran ali <imran...@gmail.com> wrote:
> Hi all,
> 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(constrai­nt);
>
>  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