I am using hibernateTemplate findByNamedQuery method to load the object.
This object has duplicate records .
Is their a way that i can load the object without duplicate records.???
Here is my NamedQuery which loads the Buildings object
The query works fine but it populates the dropdown with duplicate recordsCode:<query name="findBuildings"> <![CDATA[ select DISTINCT buildings from com.XXX.model.Building buildings order by buildings.building ]]> </query>
So i tried Native SQL query
This query results in Invalid Column nameCode:<sql-query name="findBuildings"> <return alias="obldg" class="com.boeing.nmt.nams.model.NamsBuilding"/> SELECT bldg.building AS {obldg.building} FROM Nams_Building bldg </sql-query>
Any pointers/suggestions on how to avoid loading Objects without duplicate records will be highly appreciated


Reply With Quote