dbTalk Databases Forums  

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

comp.databases.object comp.databases.object


Discuss Problems with sorting datas with db4o using orderderAscending or or derDescending functions in the comp.databases.object forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
dricou
 
Posts: n/a

Default 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


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.