<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="com.github.cstroe.spendhawk.entity">
    <class name="User" table="USERS">
        <id name="id" column="USER_ID">
            <generator class="native"/>
        </id>

        <!-- properties declared using Hibernate mapping types -->
        <property name="name" type="string" column="NAME"/>
        <set name="accounts" inverse="true">
            <key column="USER_ID"/>
            <one-to-many class="Account"/>
        </set>
        <set name="categories" inverse="true">
            <key column="USER_ID"/>
            <one-to-many class="Category"/>
        </set>
    </class>
</hibernate-mapping>
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="com.github.cstroe.spendhawk.entity">
    <class name="User" table="USERS">
        <id name="id" column="USER_ID">
            <generator class="native"/>
        </id>

        <!-- properties declared using Hibernate mapping types -->
        <property name="name" type="string" column="NAME"/>
        <set name="accounts" inverse="true" order-by="name">
            <key column="USER_ID"/>
            <one-to-many class="Account"/>
        </set>
        <set name="categories" inverse="true" order-by="name">
            <key column="USER_ID"/>
            <one-to-many class="Category"/>
        </set>
    </class>
</hibernate-mapping>
Order accounts and categories by name.
Order accounts and categories by name.
