Userinfo.hbm.xml 文件:
-------------------------------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.kmi.expert.model">
<class name="Userinfo" table="USERINFO">
<meta attribute="sync-DAO">false</meta>
<id name="id" type="integer" column="OID">
<generator class="org.hibernate.id.Assigned" />
</id>
<property name="username" column="USERNAME" type="string" not-null="true" length="8" />
<property name="password" column="PASSWORD" type="string" not-null="true" length="20" />
<property name="loginname" column="LOGINNAME" type="string" not-null="true" length="20" />
<set name="Usergroupinfos" inverse="true" lazy="true">
<key column="OID" />
<one-to-many class="Usergroupinfo" />
</set>
<set name="Userroleinfos" inverse="true" lazy="true">
<key column="OID" />
<one-to-many class="Userroleinfo" />
</set>
</class>
</hibernate-mapping>
-------------------------------------------------------------------------
<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.kmi.expert.model">
<class name="Userinfo" table="USERINFO">
<meta attribute="sync-DAO">false</meta>
<id name="id" type="integer" column="OID">
<generator class="org.hibernate.id.Assigned" />
</id>
<property name="username" column="USERNAME" type="string" not-null="true" length="8" />
<property name="password" column="PASSWORD" type="string" not-null="true" length="20" />
<property name="loginname" column="LOGINNAME" type="string" not-null="true" length="20" />
<set name="Usergroupinfos" inverse="true" lazy="true">
<key column="OID" />
<one-to-many class="Usergroupinfo" />
</set>
<set name="Userroleinfos" inverse="true" lazy="true">
<key column="OID" />
<one-to-many class="Userroleinfo" />
</set>
</class>
</hibernate-mapping>
解决方案 »
- 关于Hibernate的多表查询
- gqGrid treeGrid节点展开问题
- 请问eclipse编译 ibatis文件非常慢是什么问题啊?
- weblogic集群后,application不能复制但session能复制,导致系统出错!
- 挑战windows系统,“WEB系统”,IT发展新方向!
- 用java怎么判断一个进程是否存在
- eclipse + myeclipse + tomcat配置问题
- 怎么得到去年的星期相同的最近一天的日期?
- 如何将WAR文件导入Myeclipse中?
- hibernate一对一插入数据
- struts中一个表单提交的问题
- 【急】用cos_struts上传报错Corrupt form data: premature ending
-------------------------------------------------------------------------<?xml version="1.0"?>
<!DOCTYPE hibernate-mapping PUBLIC
"-//Hibernate/Hibernate Mapping DTD//EN"
"http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.kmi.expert.model">
<class name="Usergroupinfo" table="USERGROUPINFO">
<meta attribute="sync-DAO">false</meta>
<id name="id" type="integer" column="OID">
<generator class="org.hibernate.id.Assigned" />
</id>
<many-to-one name="userinfooid" column="USERINFOOID" class="Userinfo" not-null="true"></many-to-one>
<many-to-one name="groupoid" column="GROUPOID" class="Groups" not-null="true"></many-to-one>
</class>
</hibernate-mapping>
如何才能正确的写出一个HQL
试试