1. Hibernate: Sorting by a field from a linked table if foreign key is null stackoverflow.comLets say I have two tables - "Cat" and "Cat owner" that are linked with many-to-one like this:
|
2. How to Sort By sub field forum.hibernate.org |
3. Problem when sorting on a field that contains null forum.hibernate.orgNewbie Joined: Fri Sep 23, 2005 9:30 am Posts: 7 Hello, I am trying to sort on a field that can be null. when i sort on this field, none of the objects with the null field are returned. If i don't sort, then all the objects are returned. In concrete terms, in the mapping, etc.. below, i have the following ... |
4. Sorting on Foregin Object's field forum.hibernate.orgIn a many-to-one relationship, let say the entities are User and Organization where one organization may have thousands of users and user may not have an organization. In the User.hbm.xml, I set fetch="join" in the |
5. Sorting fields of nText type forum.hibernate.orgThanks for your reply. I've tried the following from your response. Hmm, i think i'm getting close.. My basic idea is really to cast any "nText/clob" to something sortable. But none of the syntax from the various forums seem to work... Or is there another approach 1) "from Cat c order by (cast(c.description as varchar(4000))) ASC" output: returns the same exception ... |