/home/mario/oci/jnb/dataaccess/source/resources/hibernate-config/com/ociweb/bean/Product.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.Product"
16 table="products"
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="name"
29 type="java.lang.String"
30 column="name"
31 not-null="true"
32 length="100"
33 />
34 <property
35 name="cost"
36 type="double"
37 column="cost"
38 length="4"
39 />
40
41 <!-- associations -->
42 <!-- bi-directional one-to-many association to Orderitem -->
43 <set
44 name="orderitems"
45 lazy="true"
46 inverse="true"
47 >
48 <key>
49 <column name="product" />
50 </key>
51 <one-to-many
52 class="com.ociweb.bean.Orderitem"
53 />
54 </set>
55
56 </class>
57 <query name="com.ociweb.domain.ProductMgr.findProductByName"><![CDATA[
58 from com.ociweb.bean.Product as product
59 where product.name = ?]]>
60 </query>
61 </hibernate-mapping>
62