假如我有张usr表,它与dept 是一对多关系,与authorization表是多对多关系(中间表是usrauth),那么在Usr.hbm.xml里面怎么写这种关系啊?
java 代码
- <?xml version="1.0" encoding='UTF-8'?>
- <!DOCTYPE hibernate-mapping PUBLIC
- "-//Hibernate/Hibernate Mapping DTD 2.0//EN"
- "http://hibernate.sourceforge.net/hibernate-mapping-2.0.dtd" >
-
- <!-- DO NOT EDIT: This is a generated file that is synchronized -->
- <!-- by MyEclipse Hibernate tool integration. -->
- <!-- Created Mon Feb 12 23:39:51 CST 2007 -->
- <hibernate-mapping package="com.ascenttech.hib.po">
- <class name="Usr" table="usr">
- <id name="id" column="id" type="integer">
- <generator class="native"/>
- </id>
- <property name="name" column="name" type="string" />
- <property name="passwor" column="passwor" type="string" />
- <property name="deptid" column="deptid" type="integer" />
- <property name="title" column="title" type="string" />
- <property name="power" column="power" type="string" />
- <property name="auth" column="auth" type="string" />
- <property name="male" column="male" type="string" />
- </class>
- </hibernate-mapping>