Advertisement
vrushank

User.hbm.xml

Jun 1st, 2013
81
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
XML 1.16 KB | None | 0 0
  1. <class name="User" table="users" dynamic-insert="true" dynamic-update="true">
  2.    
  3.    <id column="userID" name="userID" type="string">
  4.       <generator class="com.clixflix.generators.EntityIDGenerator" />
  5.    </id>
  6.    <property name="userName" column="userName" type="string" not-null="true" length="15" />
  7.    <property name="encrPass" column="password" type="string" not-null="true" />
  8.    <property name="firstName" column="firstName" type="string" not-null="true" length="15" />
  9.    <property name="lastName" column="lastName" type="string" length="20" />
  10.    <property name="email" column="email" type="string" length="45" />
  11.    
  12.    <!-- 1:1 mapping with Address table. -->
  13.    <many-to-one name="address"
  14.         column="addressID"
  15.         class="Address"
  16.         cascade="all"
  17.         unique="true"
  18.         not-null="false"
  19.         not-found="ignore"/> <!-- Address for a User is optional. So ignore if not found. -->
  20.  
  21.     <!--  1:n mapping with Rental table. -->
  22.     <set name="rentals" table="rentals" inverse="true" cascade="all" lazy="true">
  23.        <key column="userID" not-null="true"/>
  24.        <one-to-many class="Rental"/>
  25.     </set>
  26.    
  27. </class>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement