|
Hibernate example source code file (Person.hbm.xml)
The Hibernate Person.hbm.xml source code<!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.jpa.fetch"> <class name="Person" table="PERSON"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <property name="firstName"/> <property name="lastName"/> <property name="companyName"/> <bag name="stays" cascade="all" lazy="true" inverse="true"> <key column="PERS_ID"/> <one-to-many class="Stay"/> </bag> <bag name="oldStays" cascade="all" lazy="extra" fetch="subselect" inverse="true"> <key column="OLD_PERS_ID"/> <one-to-many class="Stay"/> </bag> <bag name="veryOldStays" cascade="all" lazy="true" fetch="select" inverse="true"> <key column="VERY_OLD_PERS_ID"/> <one-to-many class="Stay"/> </bag> </class> <class name="Stay" table="STAY"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <property name="startDate"/> <property name="endDate"/> <property name="vessel"/> <property name="authoriser"/> <property name="comments"/> <many-to-one name="person" column="PERS_ID" class="Person" cascade="all"/> <many-to-one name="oldPerson" column="OLD_PERS_ID" class="Person" cascade="all" fetch="select"/> <many-to-one name="veryOldPerson" column="VERY_OLD_PERS_ID" class="Person" cascade="all" fetch="join"/> </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.