当前位置: 动力学知识库 > 问答 > 编程问答 >

Hibernate, updating entity containing lazy collection

问题描述:

I have an entity that contains a collection (lazy load).

Is it possible to update this entity without loading the collection?

When I try I get this error message :

[AssertionFailure] - an assertion failure occured (this may indicate a bug in Hibernate, but is more likely due to unsafe use of the session)

org.hibernate.AssertionFailure: collection [...] was not processed by flush()

I do not want to load this collection just to update one field in my entity...

网友答案:

As far as I know, you cannot perform operations without loading the collection. Even if you don't explicitly mention it, Hibernate passes the default value (which I think is eager loading).

分享给朋友:
您可能感兴趣的文章:
随机阅读: