|
Hibernate example source code file (User.hbm.xml)
The Hibernate User.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"> <!-- Demonstrates use of the TIMESTAMP datatype available in Sybase and SQL Server for optimistic locking value. --> <hibernate-mapping package="org.hibernate.test.version.sybase"> <class name="User" table="syb_ts_user"> <id name="id" column="user_id" type="long"> <generator class="native"/> </id> <version name="timestamp" type="binary" generated="always"> <column name="ts" sql-type="timestamp"/> </version> <property name="username" column="user_name" type="string" unique="true"/> <set name="groups" table="syb_ts_user_group" batch-size="9" inverse="true" optimistic-lock="true" lazy="true" cascade="none" > <key column="user_id"/> <many-to-many column="group_id" class="Group" lazy="false" fetch="join" /> </set> <set name="permissions" table="syb_ts_user_perm" batch-size="9" inverse="false" optimistic-lock="false" lazy="true" cascade="none"> <key column="user_id"/> <many-to-many column="perm_id" class="Permission" lazy="false" fetch="join"/> </set> </class> <class name="Group" table="syb_ts_group"> <id name="id" column="group_id" type="long"> <generator class="native"/> </id> <timestamp name="timestamp" column="ts" source="db"/> <property name="name" column="name" type="string" unique="true"/> <set name="users" table="syb_ts_user_group" batch-size="9" inverse="false" lazy="true" cascade="none" > <key column="group_id"/> <many-to-many column="user_id" class="User" lazy="false" fetch="join" /> </set> </class> <class name="Permission" table="syb_ts_permission"> <id name="id" column="perm_id" type="long"> <generator class="native"/> </id> <timestamp name="timestamp" column="ts" source="db"/> <property name="name" column="name" type="string" unique="true"/> <property name="context" column="ctx" type="string"/> <property name="access" column="priv" type="string"/> </class> </hibernate-mapping> Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate User.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.