Hi msj4u
Thanks for quick response. You are right my query doesnt return duplicates. Infact i wrote the query in such a fashion that it doesnt written duplicates, i verified this by running the query at database
I didnt understood
Quote:
the object id of the duplicate records you see will be the same
Could you please explain
Also please note that i am retrieving data from single object, so i used DISTINCT which didn't worked . I am using Hibernate 3.2
I rewrote the query with different permutations & combinations but alwways it returns duplicates
Code:
select DISTINCT b from com.boeing.nmt.nams.model.NamsBuilding b where b.building in
(select buildings.building
from com.boeing.nmt.nams.model.NamsBuilding buildings
group by buildings.bldgId, buildings.building)
order by b.building
I put the following snippet in JSF backing bean as suggested in Hibernate forums which didnt worked
Code:
// at this point, list may contain duplicates.
// remove duplicates if any
Set setItems = new LinkedHashSet(Building);
Building.clear();
Building.addAll(setItems);
So i guess i tried everything. Pl let me know if i am missing something