Hibernate无主键配置

XML, using GeSHi 1.0.8.8
  1. <?xml version="1.0" encoding="UTF-8"?>
  2.  
  3. <!DOCTYPE hibernate-mapping PUBLIC
  4.    "-//Hibernate/Hibernate Mapping DTD 3.0//EN"
  5.    "http://hibernate.sourceforge.net/hibernate-mapping-3.0.dtd">
  6.  
  7. <hibernate-mapping>
  8.     <class name="com.quanxun.aicrm.workshield.WorkShieldView" table="C_WOR_SHE_NI_V">
  9.         <composite-id>
  10.             <key-property name="workShieldId" column="WOR_SHE_ID" type="java.lang.Long" />
  11.             <key-property name="workShieldNodeId" column="WOR_SHE_NOD_ID" type="java.lang.Long" />
  12.             <key-property name="workShieldNodeInstanceId" column="WOR_SHE_NI_ID" type="java.lang.Long" />
  13.             <key-property name="groupId" type="java.lang.Long" column="GRO_ID" />
  14.             <key-property name="userId" column="USE_ID" type="java.lang.Long" />
  15.             <key-property name="workShieldTypeId" type="java.lang.Long" column="WOR_SHE_TYP_ID" />
  16.             <key-property name="workShieldTypeName" type="java.lang.String" column="WOR_SHE_NAM" />
  17.             <key-property name="workShieldStatusId" type="java.lang.Long" column="WOR_SHE_STA_ID" />
  18.             <key-property name="workShieldStatusName" type="java.lang.String" column="WOR_SHE_STA_NAM" />
  19.             <key-property name="principalId" type="java.lang.Long" column="PRI_ID" />
  20.             <key-property name="principalName" type="java.lang.String" column="PRI_NAM" />
  21.             <key-property name="workShieldAliasId" type="java.lang.String" column="WOR_SHE_ALI_ID" />
  22.             <key-property name="criticalId" type="java.lang.Long" column="CRI_ID" />
  23.             <key-property name="criticalName" type="java.lang.String" column="CRI_NAM" />
  24.             <key-property name="shieldStartDate" type="java.lang.String" column="SHE_STA_DAT" />
  25.             <key-property name="shieldOnDate" type="java.lang.String" column="SHE_ON_DAT" />
  26.             <key-property name="shieldEndDate" type="java.lang.String" column="SHE_END_DAT" />
  27.             <key-property name="abs" type="java.lang.String" column="ABS" />
  28.             <key-property name="nodeStartDate" type="java.lang.String" column="NOD_STA_DAT" />
  29.             <key-property name="nodeOnDate" type="java.lang.String" column="NOD_ON_DAT" />
  30.             <key-property name="nodeEndDate" type="java.lang.String" column="NOD_END_DAT" />
  31.             <key-property name="workShieldNodeName" column="WOR_SHE_NOD_NAM" type="java.lang.String" />
  32.             <key-property name="nodeStatusId" type="java.lang.Long" column="STA_ID" />
  33.             <key-property name="nodeStatusName" type="java.lang.String" column="NOD_STA_NAM" />
  34.             <key-property name="userName" type="java.lang.String" column="USE_NAM" />
  35.             <key-property name="groupName" type="java.lang.String" column="GRO_NAM" />
  36.             <key-property name="isDelay" type="java.lang.Long" column="IS_DEL" />
  37.         </composite-id>
  38.     </class>
  39.  
  40. </hibernate-mapping>
  41.  
Parsed in 0.021 seconds at 133.67 KB/s

这样使用联合主键,将整个对象看作一个唯一标识。

posted @ 2011-02-18 14:11  Me疯子_(~  阅读(1589)  评论(0编辑  收藏  举报