|
Hibernate example source code file (UserGroup.hbm.xml)
The Hibernate UserGroup.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 how to use an idbag to represent a many-to-many association where the association table has a surrogate key. --> <hibernate-mapping package="org.hibernate.test.idbag"> <class name="User" table="`Users`"> <id name="name"/> <idbag name="groups" order-by="groupName asc" table="`UserGroups`"> <collection-id column="userGroupId" type="long"> <generator class="increment"/> </collection-id> <key column="userName"/> <many-to-many column="groupName" class="Group"/> </idbag> </class> <class name="Group" table="`Groups`"> <id name="name"/> </class> </hibernate-mapping> Other Hibernate examples (source code examples)Here is a short list of links related to this Hibernate UserGroup.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.