No row with the given identifier exists: [com.richcomm.ippower.entity.SysDeviceType#11]
在项目中碰到的问题:映射文件是用hibernate来反向生成的。有两个表:设备表A ,,设备类型表B
A 关联 B表。都是非主键关联。在查找时出现了异常。查了一天,发现了问题。
因为是非主键关联,从表(A)的映射文件要加上一个属性:
<many-to-one name="crb2bBroker" class="Broker" fetch="select" property-ref="brokMemberSid">
<column name="listMemberSid" length="11" not-null="true" />
</many-to-one>
来表明,关联了B表的哪个字段。
引用高手的:
http://hi.baidu.com/qrosjxuhrviptzr/item/d4016bd4ef21ebe4b3f77781