|
Hibernate example source code file (Person.hbm.xml)
The Hibernate Person.hbm.xml source code<?xml version="1.0"?> <!DOCTYPE hibernate-mapping PUBLIC "-//Hibernate/Hibernate Mapping DTD 3.0//EN" "http://www.hibernate.org/dtd/hibernate-mapping-3.0.dtd"> <!-- This mapping demonstrates (1) a table-per-subclass mapping strategy (2) a simple component mapping (3) recursive associations withing an inheritance tree --> <hibernate-mapping package="org.hibernate.test.unionsubclass2" default-access="field"> <class name="Person" table="UPerson"> <id name="id" column="person_id" unsaved-value="0"> <generator class="increment"/> </id> <property name="name" unique-key="NameUniqueKey" not-null="true" length="80"/> <property name="sex" not-null="true" update="false"/> <property name="heightInches"> <column name="height_centimeters" not-null="true" read="height_centimeters / 2.54E0" write="? * 2.54E0"/> </property> <component name="address"> <property name="address" index="AddressIndex"/> <property name="zip" index="AddressIndex"/> <property name="country"/> </component> <union-subclass name="Employee" table="UEmployee"> <property name="title" not-null="true" length="20"/> <property name="salary" length="0"/> <property name="passwordExpiryDays"> <column name="pwd_expiry_weeks" not-null="true" read="pwd_expiry_weeks * 7.0E0" write="? / 7.0E0"/> </property> <many-to-one name="manager"/> </union-subclass> <union-subclass name="Customer" table="UCustomer"> <property name="comments"/> <many-to-one name="salesperson"/> </union-subclass> </class> </hibernate-mapping> Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate Person.hbm.xml source code file: |
... this post is sponsored by my books ... | |
#1 New Release! |
FP Best Seller |
Copyright 1998-2021 Alvin Alexander, alvinalexander.com
All Rights Reserved.
A percentage of advertising revenue from
pages under the /java/jwarehouse
URI on this website is
paid back to open source projects.