首页 诗词 字典 板报 句子 名言 友答 励志 学校 网站地图
当前位置: 首页 > 教程频道 > 网站开发 > XML SOAP >

*hbm.xml投射文件的元素及属性

2013-12-15 
*.hbm.xml映射文件的元素及属性??id nameid columnw_id typeint???generator columnw_name

*.hbm.xml映射文件的元素及属性
??<id name="id" column="w_id" type="int">
???<generator column="w_name" type="string"></property>
??<property name="age" column="w_age" type="int"></property>
??<one-to-one name="myMan" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
??? ????????????????????????"-//Hibernate/Hibernate Mapping DTD 3.0//EN"
??????????????????????????? "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.amigo.dao.pojo">
??? <class name="User" table="tbl_user">
????? ??<id name="loginname" column="loginName" type="java.lang.String">
??????????? <generator column="name" type="java.lang.String"?not-null="true" />
??????? <property name="password" column="password" type="java.lang.String"?not-null="true" />
??????? <property name="mobile" column="mobile" type="java.lang.String" />
??????? <property name="telephone" column="telephone" type="java.lang.String" />
??????? <property name="email" column="email" type="java.lang.String" />
??????? <property name="createtime" column="createTime" type="java.util.Date"?not-null="true" />
??????? <property name="lastlogintime" column="lastLoginTime" type="java.util.Date" />
??????? <property name="logintimes" column="loginTimes" type="java.lang.Long"?not-null="true" />
??????? <property name="state" column="state" type="java.lang.Byte"?not-null="true" />
??????? <property name="description" column="description" type="java.lang.String" />
?
??????? <many-to-one name="organization" column="orgId" not-null="true" />
??????? <set name="userRoleSet" inverse="true" cascade="all-delete-orphan" lazy="true">
??????????? <key column="loginName"/>
??????????? <one-to-many encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
??????????????????????????? "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
??????????????????????????? "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.amigo.dao.pojo">
??? <class name="Organization" table="tbl_organization">
??????? <id name="orgid" column="orgId" type="java.lang.Long">
??????????? <generator column="parentOrgId" type="java.lang.Long"?not-null="true" />
??????? <property name="orgname" column="orgName" type="java.lang.String"?not-null="true" />
??????? <property name="orgfullname" column="orgFullName" type="java.lang.String" />
??????? <property name="orglevel" column="orgLevel" type="java.lang.Integer"?not-null="true" />
??????? <property name="state" column="state" type="java.lang.Byte"?not-null="true" />
??????? <property name="description" column="description" type="java.lang.String" />
??????? <property name="creator" column="creator" type="java.lang.String" />
??????? <property name="createtime" column="createTime" type="java.util.Date" />
??????? <set name="userSet" inverse="true" lazy="true">
??????????? <key column="orgId"/>
??????????? <one-to-many encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
??????????????????????????? "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
??????????????????????????? "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.cotel.netvote.dao.model">
??? <class name="UserRole" table="tbl_user_role">
??????? <id name="urid" column="urId" type="java.lang.Integer">
??????????? <generator column="roleId" />
??????? <many-to-one name="user" column="loginName" />
??? </class>
</hibernate-mapping>
(4)tbl_ role
<?xml version="1.0" encoding='UTF-8'?>
<!DOCTYPE hibernate-mapping PUBLIC
??????????????????????????? "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
??????????????????????????? "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd" >
<hibernate-mapping package="com.cotel.netvote.dao.model">
??? <class name="Role" table="tbl_role">
??????? <id name="roleid" column="roleId" type="java.lang.Integer">
??????????? <generator column="roleName" type="java.lang.String"?not-null="true" />
??????? <property name="createdate" column="createDate" type="java.util.Date"?not-null="true" />
??????? <property name="description" column="description" type="java.lang.String" />
?
??????? <set name="userRoleSet" inverse="true" lazy="true" cascade="all">
??????????? <key column="roleId"/>
??????????? <one-to-many class="UserRole"/>
??????? </set>
??? </class>
</hibernate-mapping>

热点排行