Pages

Saturday, February 25, 2012

Hibernate mapping


<hibernate-mapping>
    <class name="com.GamersCom.domain.Group" table="accesslevel" catalog="gamers">
        <id name="level" type="java.lang.Integer">
            <column name="level" />
            <generator class="identity" />
        </id>
        <property name="name" type="string">
            <column name="name" length="45" not-null="true" />
        </property>
        
    </class>
</hibernate-mapping>

With "catalog" property, Hibernate will generate HQL like this.

Hibernate: select group0_.level as level1_, group0_.name as name1_ from gamers.gamers.accesslevel group0_




No comments:

Post a Comment