Hibernate无主键配置
XML, using GeSHi 1.0.8.8
- <?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>
- <class name="com.quanxun.aicrm.workshield.WorkShieldView" table="C_WOR_SHE_NI_V">
- <composite-id>
- <key-property name="workShieldId" column="WOR_SHE_ID" type="java.lang.Long" />
- <key-property name="workShieldNodeId" column="WOR_SHE_NOD_ID" type="java.lang.Long" />
- <key-property name="workShieldNodeInstanceId" column="WOR_SHE_NI_ID" type="java.lang.Long" />
- <key-property name="groupId" type="java.lang.Long" column="GRO_ID" />
- <key-property name="userId" column="USE_ID" type="java.lang.Long" />
- <key-property name="workShieldTypeId" type="java.lang.Long" column="WOR_SHE_TYP_ID" />
- <key-property name="workShieldTypeName" type="java.lang.String" column="WOR_SHE_NAM" />
- <key-property name="workShieldStatusId" type="java.lang.Long" column="WOR_SHE_STA_ID" />
- <key-property name="workShieldStatusName" type="java.lang.String" column="WOR_SHE_STA_NAM" />
- <key-property name="principalId" type="java.lang.Long" column="PRI_ID" />
- <key-property name="principalName" type="java.lang.String" column="PRI_NAM" />
- <key-property name="workShieldAliasId" type="java.lang.String" column="WOR_SHE_ALI_ID" />
- <key-property name="criticalId" type="java.lang.Long" column="CRI_ID" />
- <key-property name="criticalName" type="java.lang.String" column="CRI_NAM" />
- <key-property name="shieldStartDate" type="java.lang.String" column="SHE_STA_DAT" />
- <key-property name="shieldOnDate" type="java.lang.String" column="SHE_ON_DAT" />
- <key-property name="shieldEndDate" type="java.lang.String" column="SHE_END_DAT" />
- <key-property name="abs" type="java.lang.String" column="ABS" />
- <key-property name="nodeStartDate" type="java.lang.String" column="NOD_STA_DAT" />
- <key-property name="nodeOnDate" type="java.lang.String" column="NOD_ON_DAT" />
- <key-property name="nodeEndDate" type="java.lang.String" column="NOD_END_DAT" />
- <key-property name="workShieldNodeName" column="WOR_SHE_NOD_NAM" type="java.lang.String" />
- <key-property name="nodeStatusId" type="java.lang.Long" column="STA_ID" />
- <key-property name="nodeStatusName" type="java.lang.String" column="NOD_STA_NAM" />
- <key-property name="userName" type="java.lang.String" column="USE_NAM" />
- <key-property name="groupName" type="java.lang.String" column="GRO_NAM" />
- <key-property name="isDelay" type="java.lang.Long" column="IS_DEL" />
- </composite-id>
- </class>
-
- </hibernate-mapping>
-
Parsed in 0.021 seconds at 133.67 KB/s
这样使用联合主键,将整个对象看作一个唯一标识。