|
Hibernate example source code file (Properties.hbm.xml)
The Hibernate Properties.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.any"> <class name="PropertySet" table="T_PROP_SET"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <property name="name" column="NAME" type="string"/> <any name="someSpecificProperty" id-type="long" meta-type="string" cascade="all"> <meta-value value="I" class="IntegerPropertyValue"/> <meta-value value="S" class="StringPropertyValue"/> <meta-value value="C" class="ComplexPropertyValue" /> <column name="S_S_PROP_TYPE"/> <column name="S_S_PROP_ID"/> </any> <map name="generalProperties" table="T_GEN_PROPS" lazy="true" cascade="all"> <key column="PROP_SET_ID"/> <map-key type="string" column="GEN_PROP_NAME"/> <many-to-any id-type="long" meta-type="string"> <meta-value value="I" class="IntegerPropertyValue"/> <meta-value value="S" class="StringPropertyValue"/> <column name="PROP_TYPE"/> <column name="PROP_ID"/> </many-to-any> </map> </class> <class name="StringPropertyValue" table="T_CHAR_PROP"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <property name="value" column="VAL" not-null="true" type="string"/> </class> <class name="IntegerPropertyValue" table="T_NUM_PROP"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <property name="value" column="VAL" not-null="true" type="integer"/> </class> <class name="ComplexPropertyValue" table="T_COMPLEX_PROP"> <id name="id" column="ID" type="long"> <generator class="increment"/> </id> <map name="subProperties" table="T_COMPLEX_SUB_PROPS" lazy="true"> <key column="PROP_ID" /> <map-key type="string" column="SUB_PROP_NAME" /> <element type="string" column="SUB_PROP_VAL" /> </map> </class> </hibernate-mapping> Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate Properties.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.