java hibernate 无主键表 更新

遇到这样的问题,用hibernate 开发,myeclipse 反向生成映射文件,现有表eventAlert,此表是个没有主键的表,生成的映射文件,如下:

<hibernate-mapping>
<class name="com.tomsync.vo.EventAlert" table="EventAlert" catalog="obm">
<composite-id name="id" class="com.tomsync.vo.EventAlertId">
<key-property name="eventalertTimeupdate" type="java.util.Date">
<column name="eventalert_timeupdate" length="19" />
</key-property>
<key-property name="eventalertTimecreate" type="java.util.Date">
<column name="eventalert_timecreate" length="19" />
</key-property>
<key-many-to-one name="userObm" class="com.tomsync.vo.UserObm">
<column name="eventalert_userupdate" />
</key-many-to-one>
<key-many-to-one name="userObm_1" class="com.tomsync.vo.UserObm">
<column name="eventalert_usercreate" />
</key-many-to-one>
<key-many-to-one name="event" class="com.tomsync.vo.Event">
<column name="eventalert_event_id" />
</key-many-to-one>
<key-many-to-one name="userObm_2" class="com.tomsync.vo.UserObm">
<column name="eventalert_user_id" />
</key-many-to-one>
<key-property name="eventalertDuration" type="java.lang.Integer">
<column name="eventalert_duration" />
</key-property>
</composite-id>
<many-to-one name="userObmByEventalertUserupdate" class="com.tomsync.vo.UserObm" update="false" insert="false" fetch="select">
<column name="eventalert_userupdate" />
</many-to-one>
<many-to-one name="userObmByEventalertUserId" class="com.tomsync.vo.UserObm" update="false" insert="false" fetch="select">
<column name="eventalert_user_id" />
</many-to-one>
<many-to-one name="event" class="com.tomsync.vo.Event" update="false" insert="false" fetch="select">
<column name="eventalert_event_id" />
</many-to-one>
<many-to-one name="userObmByEventalertUsercreate" class="com.tomsync.vo.UserObm" update="false" insert="false" fetch="select">
<column name="eventalert_usercreate" />
</many-to-one>
</class>
</hibernate-mapping>


如上,虚拟出类 com.tomsync.vo.EventAlertId 作为它的主键,在项目中,读取,没有问题,当我要对 com.tomsync.vo.EventAlertId 类中的 eventalertDuration 做更新的时候,不抱异常,项目运行一切正常,但是,库中的数据就是没有改过来。还是新建时候的数据。
请问,对于虚拟出来的主键 com.tomsync.vo.EventAlertId 类中的属性 eventalertDuration 是不是不可修改?
  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值