|
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"> <!-- --> <hibernate-mapping package="org.hibernate.test.deletetransient"> <class name="Person" table="T_PERSON"> <id name="id" type="long"> <generator class="increment"/> </id> <property name="name" type="string"/> <set name="addresses" lazy="true" inverse="false" cascade="all"> <key column="PERSON_ID"/> <one-to-many class="Address"/> </set> <bag name="friends" lazy="true" inverse="false" cascade="all" table="T_FRIENDS"> <key column="FRIEND_ID_1"/> <many-to-many class="Person" column="FRIEND_ID_2"/> </bag> </class> <class name="Address" table="T_ADDRESS"> <id name="id" type="long"> <generator class="increment"/> </id> <property name="info" type="string"/> <set name="suites" lazy="true" inverse="false" cascade="all-delete-orphan"> <key column="ADDRESS_ID"/> <one-to-many class="Suite"/> </set> </class> <class name="Suite" table="T_SUITE"> <id name="id" type="long"> <generator class="increment"/> </id> <property name="location" type="string"/> <set name="notes" lazy="true" inverse="false" cascade="all-delete-orphan"> <key column="SUITE_ID"/> <one-to-many class="Note"/> </set> </class> <class name="Note" table="T_NOTE"> <id name="id" type="long"> <generator class="increment"/> </id> <property name="description" type="string"/> </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.