forked from hibernate/hibernate-tools
/
GenericModel.hbm.xml
34 lines (24 loc) · 1.07 KB
/
GenericModel.hbm.xml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
"http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd">
<hibernate-mapping package="org.hibernate.tool.hbm2x">
<class name="GenericObject" table="GENERIC_OBJECT">
<id name="id" type="long">
<generator class="native"></generator>
</id>
<property name="name" type="string"/>
<map name="values" cascade="save-update" table="GENERIC_VALUES" lazy="false" inverse="false" fetch="join">
<key column="OWNER" not-null="true"/>
<map-key type="long" column="MAP_KEY"/>
<one-to-many class="GenericValue"/>
</map>
</class>
<class name="GenericValue" table="GENERIC_VALUE">
<id name="id" type="long">
<generator class="native"></generator>
</id>
<property name="value" type="string"/>
<many-to-one name="owner" class="GenericObject" column="OWNER" not-null="true" insert="false" update="false"/>
</class>
</hibernate-mapping>