Lets say I have two tables - "Cat" and "Cat owner" that are linked with many-to-one like this:
<class name="com.example.Cat" table="cat">
...
<many-to-one name="owner"
class="com.example.CatOwner"
column="owner_id"
not-null="false" insert="true" update="true" cascade="none" lazy="false"/>
</class>
Now I want to get a list of all cats sorted by cat owner names, like this:
session.createQuery("from Cat cat order by cat.owner.name");
The problem is if a cat doesn't have an owner (owner_id=NULL), that cat won't be selected with this query. How can I make cats without owners to be present in the result?
Thanks.