/home/mario/oci/jnb/dataaccess/source/resources/hibernate-config/com/ociweb/bean/Orderitem.hbm.xml

1    <?xml version="1.0"?> 
2    <!DOCTYPE hibernate-mapping PUBLIC 
3        "-//Hibernate/Hibernate Mapping DTD 2.0//EN" 
4        "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" > 
5         
6    <hibernate-mapping> 
7    <!--  
8        Created by Middlegen Hibernate plugin 
9     
10       http://boss.bekk.no/boss/middlegen/ 
11       http://hibernate.sourceforge.net/ 
12   --> 
13    
14   <class  
15       name="com.ociweb.bean.Orderitem"  
16       table="orderitems" 
17   > 
18    
19       <id 
20           name="id" 
21           type="long" 
22           column="id" 
23       > 
24           <generator class="increment" /> 
25       </id> 
26    
27       <property 
28           name="quantity" 
29           type="int" 
30           column="quantity" 
31           not-null="true" 
32           length="4" 
33       /> 
34    
35       <!-- associations --> 
36       <!-- bi-directional many-to-one association to Product --> 
37       <many-to-one 
38           name="product" 
39           class="com.ociweb.bean.Product" 
40           not-null="true" 
41       > 
42           <column name="product" /> 
43       </many-to-one> 
44       <!-- bi-directional many-to-one association to Order --> 
45       <many-to-one 
46           name="order" 
47           class="com.ociweb.bean.Order" 
48           not-null="true" 
49       > 
50           <column name="orders" /> 
51       </many-to-one> 
52    
53   </class> 
54   </hibernate-mapping> 
55