|
Hibernate example source code file (MasterDetail.hbm.xml)
The Hibernate MasterDetail.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 default-lazy="false"> <class name="org.hibernate.test.legacy.Master" table="`master`"> <meta attribute="foo">foo <id name="id" column="master_key_column" type="long"> <generator class="native"/> </id> <version name="version" access="field"/> <!--version type="timestamp" name="stamp" column="ts_"/--> <!--timestamp name="stamp" column="ts_"/--> <property name="name"> <meta attribute="bar">bar <meta attribute="bar">bar2 </property> <property name="x"/> <property name="bigDecimal" column="big_dec" precision="7" scale="3"/> <set name="details" inverse="true" lazy="true" order-by="i asc"> <key column="master_key"/> <one-to-many class="org.hibernate.test.legacy.Detail"/> </set> <set name="moreDetails" cascade="all" lazy="true" order-by="i desc"> <key column="more_master_key"/> <one-to-many class="org.hibernate.test.legacy.Detail"/> </set> <set name="incoming" lazy="true" table="mtm"> <key foreign-key="AA" column="outgoingabcdef"/> <many-to-many class="org.hibernate.test.legacy.Master" foreign-key="BB"> <column name="incomingabcdef" index="IBB"/> </many-to-many> </set> <set name="outgoing" lazy="true" table="mtm" inverse="true"> <key column="incomingabcdef"/> <many-to-many class="org.hibernate.test.legacy.Master" column="outgoingabcdef"/> </set> <many-to-one name="otherMaster"/> <!--query-list name="allDetails" query-ref="all_details"/--> </class> <class name="org.hibernate.test.legacy.Detail"> <id column="detail_key_column" type="long"> <generator class="native"/> </id> <property name="x"> <column name="x" unique-key="uk" not-null="true"/> </property> <property name="i"> <column name="i" unique-key="uk" not-null="true"/> </property> <many-to-one name="master" foreign-key="CC"> <column name="master_key" unique-key="uk" not-null="true"/> </many-to-one> <!-- Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate MasterDetail.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.