中间表多字段且联合主键-xml配置文件

<hibernate-mapping>
    <class name="com.xunware.modelresource.prototype.SysMrBasicAttrSelect" table="SYS_MR_BASIC_ATTR_SELECT" >
        <composite-id name="id" class="com.xunware.modelresource.prototype.SysMrBasicAttrSelectId">
            <key-many-to-one name="sysMrModelAttrBasic" class="com.xunware.modelresource.prototype.SysMrModelAttrBasic">
                <column name="MODEL_ATTRIBUTE_ID" precision="22" scale="0" />
            </key-many-to-one>
            <key-many-to-one name="sysMrAttrSelectType" class="com.xunware.modelresource.prototype.SysMrAttrSelectType">
                <column name="SELECT_TYPE_ID" precision="22" scale="0" />
            </key-many-to-one>
        </composite-id>
    </class>
</hibernate-mapping>
<hibernate-mapping>
    <class name="com.xunware.modelresource.prototype.SysMrAttrSelect" table="SYS_MR_ATTR_SELECT" >
        <composite-id name="id" class="com.xunware.modelresource.prototype.SysMrAttrSelectId">
            <key-many-to-one name="sysMrAttrSelectType" class="com.xunware.modelresource.prototype.SysMrAttrSelectType">
                <column name="SELECT_TYPE_ID" precision="22" scale="0" />
            </key-many-to-one>
            <key-property name="selectValue" type="java.lang.String">
                <column name="SELECT_VALUE" length="60" />
            </key-property>
            <key-property name="attributeName" type="java.lang.String">
                <column name="ATTRIBUTE_NAME" length="60" />
            </key-property>
            <key-property name="defaultSelect" type="java.lang.Long">
                <column name="DEFAULT_SELECT" precision="22" scale="0" />
            </key-property>
            <key-property name="priority" type="java.lang.Long">
                <column name="PRIORITY" precision="22" scale="0" />
            </key-property>
        </composite-id>
        <many-to-one name="sysMrAttrSelectType" class="com.xunware.modelresource.prototype.SysMrAttrSelectType" update="false" insert="false" fetch="select">
            <column name="SELECT_TYPE_ID" precision="22" scale="0" not-null="true" />
        </many-to-one>
    </class>
</hibernate-mapping>

你可能感兴趣的:(配置文件)