Problems with sorting datas with db4o using orderderAscending or or derDescending functions

From: dricou <cedric.alliet_at_wanadoo.fr>
Date: 6 Dec 2005 01:02:58 -0800
Message-ID: <1133859778.082578.62730_at_g44g2000cwa.googlegroups.com>



Hi,

I have created an object called result with several attributes. Then I have inserted approximately 10 000 object. I can get the data and display them but I'd like to know if it is possible, using db4o's functions, to create a request which enable to sort initially by name (of String type) and, then, to sort by num (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 Received on Tue Dec 06 2005 - 10:02:58 CET

Original text of this message