~raginggoblin/infolog/infolog

« back to all changes in this revision

Viewing changes to InfologServer/lib/hibernate-distribution-3.3.2.GA/project/testsuite/src/test/java/org/hibernate/test/propertyref/inheritence/joined/Person.hbm.xml

  • Committer: Raging Goblin
  • Date: 2013-11-16 16:51:32 UTC
  • Revision ID: raging_goblin-20131116165132-weujnptzc88uy4ah
Mavenized the project, now using shared project InfologSync

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<?xml version="1.0"?>
2
 
<!DOCTYPE hibernate-mapping PUBLIC 
3
 
        "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
4
 
        "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
5
 
 
6
 
<!--
7
 
 
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:
11
 
  
12
 
  (1) A one-to-one foreign key association (prefer primary key 
13
 
      associations)
14
 
      
15
 
  (2) A bidirectional one-to-many association on a key that is
16
 
      not the primary key (prefer associations from foreign keys
17
 
      to primary keys)
18
 
 
19
 
-->
20
 
 
21
 
<hibernate-mapping package="org.hibernate.test.propertyref.inheritence.joined">
22
 
 
23
 
        <class name="Person" table="J_SBCLS_PROPREF_PERS">
24
 
                <id name="id">
25
 
                        <generator class="hilo"/>
26
 
                </id>
27
 
                <property name="name" length="100"/>
28
 
                <many-to-one name="bankAccount" property-ref="bsbAccountNumber" cascade="all">
29
 
                        <column name="bsb"/>
30
 
                        <column name="accountNumber"/>
31
 
                </many-to-one>
32
 
        </class>
33
 
        
34
 
        <class name="Account" table="J_SBCLS_PROPREF_ACCT">
35
 
                <id name="accountId" length="32">
36
 
                        <generator class="uuid"/>
37
 
                </id>
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"/>
44
 
                        </properties>
45
 
                </joined-subclass>
46
 
                
47
 
        </class>
48
 
 
49
 
</hibernate-mapping>
 
 
b'\\ No newline at end of file'