|
Hibernate example source code file (Item.hbm.xml)
The Hibernate Item.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"> <!-- This mapping demonstrates a mixed inheritance strategy, with one subclass acting like a joined-subclass via use of a <join>. Also notice the fields which are initialized by an interceptor. --> <hibernate-mapping package="org.hibernate.test.mixed"> <class name="Item" table="Files" discriminator-value="I"> <id name="id"> <generator class="native"/> </id> <discriminator type="character" column="itemType"/> <property name="name"> <column name="name" not-null="true" /> <!--unique-key="folder-parent"--> </property> <many-to-one name="parent" class="Folder"> <column name="parentFolderId" /> <!--unique-key="folder-parent"--> </many-to-one> <subclass name="Document" discriminator-value="D" lazy="true" dynamic-update="true"> <property name="content"/> <!-- managed by DocumentInterceptor --> <property name="modified"/> <property name="created"/> <subclass name="SecureDocument" discriminator-value="S" dynamic-update="true" lazy="true"> <join table="SecureDocument"> <key column="documentId"/> <property name="permissionBits" not-null="true"/> <property name="owner" not-null="true"/> </join> </subclass> </subclass> <subclass name="Folder" discriminator-value="F"/> </class> </hibernate-mapping> Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate Item.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.