Hi,
I am using Hibernate3.jar in our App.While trying to fetch some objects using the foreign key we used the order-by clause on the collection as shown below
< set name="children" cascade="all-delete-orphan" lazy="true" order-by="SORT_ORDER_ID asc,lower(CHILD_NAME) asc,lower(FIRST_NAME) asc,lower(LAST_NAME) asc">
Now i have a class where i am using the Criteria API and forcing to fetch the "children" objects using the join class i.e using fetch=join in the Criteria Api.But the problem comes when i try to put an orderby clause in Criteria api.It always seem to pick the order-by clause from the .hbm file (as shown in bold above) and appends my new orderby clause from the criteria api.Why does it append, why it doesnot ignore the order-by from .hbm and just use the one mentioned in Criteria api.