Hi,

You're solution only seems to filter out the duplicates based on hashmap
logic, this of course only works when the method hashCode() has properly
been implemented.  [And... does this suggested solution support the
paging (pagination) implementation?]

But more critical.... since the resultset is delivered as a hashset, we
lost all sense of ordering, and that is not what we want here. Hence the
problem remains.

So is their a another way on how to avoid duplicated objects in the
resultset?

Roger Janssen
iBanx

-----Original Message-----
From: Jakob Braeuchi [mailto:[EMAIL PROTECTED] 
Sent: Friday, June 16, 2006 9:11 PM
To: OJB Users List
Subject: Re: Bug : duplicate objects in resultset

hi roger,

the following works for me. i use a set instead of a collection:

     public void testOrderByJoined2()
     {
         Criteria crit = new Criteria();
         QueryByCriteria q = QueryFactory.newQuery(Project.class, crit,
true);
         q.addOrderByAscending("persons.lastname");

         Collection results = broker.getCollectionByQuery(q);
         assertNotNull(results);

         ManageableHashSet resultsMgmt = (ManageableHashSet)
broker.getCollectionByQuery(RemovalAwareSet.class, q);
         assertNotNull(resultsMgmt);

         // compare with count
         int count = broker.getCount(q);
         assertEquals(resultsMgmt.size(), count);
     }

hth
jakob


*************************************************************************T
 he information contained in this communication is confidential and is 
intended solely for the use of the individual or entity to  whom it is 
addressed.You should not copy, disclose or distribute this communication 
without the authority of iBanx bv. iBanx bv is neither liable for 
the proper and complete transmission of the information has been maintainedn
 or that the communication is free of viruses, interceptions or 
interference. 

If you are not the intended recipient of this communication please returnt
 he communication to the sender and delete and destroy all copies. 

---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to