日期:2014-05-20  浏览次数:20605 次

hibernate联合主键问题
Oralce里面不能有两个主键....之前有个自增键为主键,为了更好的方便业务实现,我要弄个联合主键,但是配置文件不支持自增键和联合主键同时存在。。求解决策略
XML code

 <id name="afterCommId" type="java.lang.Long">
            <column name="AFTERCOMMID" precision="10" scale="0" />
            <generator class="sequence">
                <param name="sequence">seq_AfterCommission</param>
            </generator>
        </id>
       <composite-id name="afterCommissionPKID" class="com.neili.mdgl.hibernate.mdyj.entity.AfterCommissionPKID">
               <key-many-to-one name="storeNumber" class="com.neili.mdgl.hibernate.mdyj.entity.StoreAfter" lazy="false">
                   <column name="STORENUMBER" precision="10" scale="0" />
               </key-many-to-one>
               <key-property name="paymentType" type="java.lang.Integer">
                   <column name="PAYMENTTYPE" />
               </key-property>
               <key-property name="areaId" type="java.lang.String">
                    <column name="AREAID"/>
               </key-property>
       </composite-id>



怎么弄啊、联合主键我是要定了

------解决方案--------------------
找我,帮你搞定