Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <class name="User" table="users" dynamic-insert="true" dynamic-update="true">
- <id column="userID" name="userID" type="string">
- <generator class="com.clixflix.generators.EntityIDGenerator" />
- </id>
- <property name="userName" column="userName" type="string" not-null="true" length="15" />
- <property name="encrPass" column="password" type="string" not-null="true" />
- <property name="firstName" column="firstName" type="string" not-null="true" length="15" />
- <property name="lastName" column="lastName" type="string" length="20" />
- <property name="email" column="email" type="string" length="45" />
- <!-- 1:1 mapping with Address table. -->
- <many-to-one name="address"
- column="addressID"
- class="Address"
- cascade="all"
- unique="true"
- not-null="false"
- not-found="ignore"/> <!-- Address for a User is optional. So ignore if not found. -->
- <!-- 1:n mapping with Rental table. -->
- <set name="rentals" table="rentals" inverse="true" cascade="all" lazy="true">
- <key column="userID" not-null="true"/>
- <one-to-many class="Rental"/>
- </set>
- </class>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement