<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="uk.ac.ox.oucs.oauth.domain">
    <class name="Consumer" table="OAUTH_CONSUMERS">
        <id name="id" type="string">
            <column name="id"/>
        </id>
        <set name="rights" table="OAUTH_RIGHTS">
            <key column="id"/>
            <element type="string" column="accessright" not-null="true"/>
        </set>

        <property name="name" type="string" not-null="true"/>
        <property name="description" type="string"/>
        <property name="URL" type="string"/>
        <property name="callbackURL" type="string"/>
        <property name="secret" type="string" not-null="true"/>
        <property name="accessorSecret" type="string"/>
        <property name="defaultValidity" type="int" not-null="true"/>
    </class>
</hibernate-mapping>

<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">

<hibernate-mapping package="uk.ac.ox.oucs.oauth.domain">
    <class name="Consumer" table="OAUTH_CONSUMERS">
        <id name="id" type="string">
            <column name="id"/>
        </id>
        <set name="rights" table="OAUTH_RIGHTS" lazy="false" >
            <key column="id"/>
            <element type="string" column="accessright" not-null="true"/>
        </set>

        <property name="name" type="string" not-null="true"/>
        <property name="description" type="string"/>
        <property name="URL" type="string"/>
        <property name="callbackURL" type="string"/>
        <property name="secret" type="string" not-null="true"/>
        <property name="accessorSecret" type="string"/>
        <property name="defaultValidity" type="int" not-null="true"/>
    </class>
</hibernate-mapping>

Enable eager loading for consumers' rights
Enable eager loading for consumers' rights
