使用hibernate和Hsqldb - 对象列表通过事务进行session.merged。当调用session.flush()时,我得到一个“列列表中的重复列名:x”,其中x是第一列。
数据库表没有重复的列,我能够正常读取数据。该表包含一个复合主键,我在映射文件中将其处理为:
<composite-id>
<key-property name="x"></key-property>
<key-property name="y"></key-property>
</composite-id>
<property name="x" type="string" unique="false"
optimistic-lock="true" lazy="false" generated="never">
<column name="X" length="10" not-null="true" unique="false" />
</property>
<property name="y" type="string" unique="false"
optimistic-lock="true" lazy="false" generated="never">
<column name="Y" length="18" not-null="true"
unique="false" />
</property>
由于
答案 0 :(得分:0)
您正在映射X&amp; Y两次。如果您说它是复合ID,则无需将其重新映射为属性。
<composite-id>
<key-property name="x"></key-property>
<key-property name="y"></key-property>
</composite-id>