Reputation: 4917
Hibernate mapping order-by ignore case.
<set name="documents" inverse="true" order-by="DOC_NAME" cascade="all-delete-orphan">
<key column="ID"/>
<one-to-many class="com.abac.Document" />
</set>
This code returns the ordered list of document but fail in case of capital letters and small letters.
Is there any settings in hibernate mapping that ignore case in order-by.
using oracle db.
Upvotes: 2
Views: 262
Reputation: 2626
Just add UPPER
or LOWER
in order-by
like this. I have used it before and this is what i have done at that time, as far as i remember correctly.
order-by="UPPER(DOC_NAME)"
And you can have a look at the sort
property as well at this link sort property
Upvotes: 1