|
Hibernate example source code file (ABC.hbm.xml)
The Hibernate ABC.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.A" discriminator-value="0" lazy="true" table="TA"> <id name = "id" column="identifier_column" unsaved-value = "null"> <generator class="increment"/> </id> <discriminator column="clazz_discriminata" type="integer" not-null="false"/> <property name="name" index="indx_a_name"> <column name="name" index="indx_a_name2"/> </property> <subclass name="org.hibernate.test.legacy.B" discriminator-value="-1" lazy="true"> <property name="count" column="count_"/> <join fetch="select" table="B2"> <key column="bid"/> <property name="BName" not-null="true"/> </join> <subclass name="org.hibernate.test.legacy.C1" discriminator-value="null" lazy="true"> <property name="address" column="c1"/> <one-to-one name="d"/> <join table="cmore" fetch="select"> <key column="c1" on-delete="cascade"/> <property name="C1Name"/> </join> </subclass> </subclass> </class> <class name="org.hibernate.test.legacy.D" discriminator-value="0" proxy="org.hibernate.test.legacy.D" table="TD"> <id name = "id" unsaved-value = "null"> <generator class="assigned"/> </id> <property name="amount"/> <!-- these definitions both relied on the ability to save A with alternate assigned id <many-to-one name="reverse" insert="false" update="false" outer-join="true"> <formula>(id) </many-to-one> <many-to-one name="inverse" access="field" insert="false" update="false" formula = "(id)" outer-join="true"/> --> <many-to-one name="reverse" column="rev_a_id" outer-join="true"/> <many-to-one name="inverse" access="field" column="inv_a_id" outer-join="true"/> <!--many-to-one name="reverse" formula = "(select a.id from TA a where a.id = id)"/--> </class> <sql-query name="propertyResultDiscriminator"> <return alias="a" class="org.hibernate.test.legacy.A"> <return-discriminator column="clazz"/> <return-property name="id" column="identifier_column"/> <return-property name="name" column="name"/> <return-property name="count" column="count_"/> </return> select identifier_column, clazz_discriminata as clazz, name, count_ from TA s </sql-query> </hibernate-mapping> Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate ABC.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.