我有一個Hibernate映射它是這樣的
<class name="Person">
<id name="id" type="long" column="person_id" unsaved-value="null">
<generator class="sequence">
<param name="sequence">person_id_seq</param>
</generator>
</id>
...
<set name="thinCollection" table="(select person_id, person_property from some_other_table where another_property = 'something')" fetch="subselect" lazy="false">
<key column="person_id"/>
<element column="person_property" type="long"/>
</set>
...
</class>
現在我的問題是,當一個人對象被刷新,它嘗試執行鍼對Person#thinCollection的集合刪除操作,該操作因嘗試執行delete from (select person_id, person_property from some_other_table where another_property = 'something')
而失敗。
因此,我該如何阻止Hibernate執行這些操作(以及更新和插入)?
感謝
我很驚訝,hibernate讓你變得更遠......是甚至是支持的配置? – skaffman 2009-06-22 19:27:19
顯然,它是。 ..直到你得到實體的沖洗,然後你會遇到我剛剛發佈的內容。 – 2009-06-22 20:13:14