2
<!DOCTYPE hibernate-mapping PUBLIC
3
"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
4
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
8
Demonstrates the use of property-ref to map legacy data where
9
foreign keys reference something other than the primary key of
10
the associated entity. Here we show:
12
(1) A one-to-one foreign key association (prefer primary key
15
(2) A bidirectional one-to-many association on a key that is
16
not the primary key (prefer associations from foreign keys
21
<hibernate-mapping package="org.hibernate.test.propertyref.inheritence.joined">
23
<class name="Person" table="J_SBCLS_PROPREF_PERS">
25
<generator class="hilo"/>
27
<property name="name" length="100"/>
28
<many-to-one name="bankAccount" property-ref="bsbAccountNumber" cascade="all">
30
<column name="accountNumber"/>
34
<class name="Account" table="J_SBCLS_PROPREF_ACCT">
35
<id name="accountId" length="32">
36
<generator class="uuid"/>
38
<property name="type" not-null="true"/>
39
<joined-subclass name="BankAccount" table="J_SBCLS_PROPREF_BACCT">
40
<key column="accountId"/>
41
<properties unique="true" name="bsbAccountNumber">
42
<property name="bsb" length="4" not-null="true"/>
43
<property name="accountNumber" length="16" not-null="true"/>
b'\\ No newline at end of file'