Problems with sorting datas with db4o using orderderAscending or or derDescending functions -
12-06-2005
, 03:07 AM
Hi,
I have created a class "result" with several attributes. Then I have
inserted approximately 10000 object result, stored in a yap file.
I can get the data and display them. I'd like to know if it is
possible, using the functions of db4o, to create a request in order to
to get the datas and sort them initially by name (of String type) and,
then, of sorting by num (of int type).
I have tried for example the following code :
Query query = db.query();
query.constrain(Result.class);
query.descend("name").orderDescending();
query.descend("num").orderDescending();
ObjectSet result1 = query.execute();
It works nearly successfully but the data sometimes are not correctly
sorted. Is it a this bug in the functions or is the code not correct?
In the last case, would it be possible to have a correct example ?
How to solve this problem?
Thanks in advance
AC |