今天在练习一个例子的时候出现了一个错误,
could not fetch initial value for increment generator
Caused by: java.sql.SQLException: 列名 'id' 无效。
其中映射文件中的内容如下,这个只是Roel.hbm.xml中的。在User.hbm.xml中的相似。<idbag
name="users"
lazy="true"
cascade="all"
table="user_role" >
<collection-id column="id" type="integer" >
<generator class="increment"/>
</collection-id>
<key>
<column name="roleid" />
</key>
<many-to-many
class="cn.lzt.vo1.User"
column="userid"
/>
</idbag>我觉得问题就出在collection-id中,请高手帮忙。
谢谢!
could not fetch initial value for increment generator
Caused by: java.sql.SQLException: 列名 'id' 无效。
其中映射文件中的内容如下,这个只是Roel.hbm.xml中的。在User.hbm.xml中的相似。<idbag
name="users"
lazy="true"
cascade="all"
table="user_role" >
<collection-id column="id" type="integer" >
<generator class="increment"/>
</collection-id>
<key>
<column name="roleid" />
</key>
<many-to-many
class="cn.lzt.vo1.User"
column="userid"
/>
</idbag>我觉得问题就出在collection-id中,请高手帮忙。
谢谢!
解决方案 »
免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货