Win a copy of The Little Book of Impediments (e-book only) this week in the Agile and Other Processes forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Is it possible to load a collection but not save it in Hibernate

 
Chase Bonham
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
<class name="eg.Parent">
<set name="children" cascade="all-delete-orphan" inverse="true" sort="unsorted" >
<key column="id" />
<one-to-many class="eg.Child" />
</set>

</class>

<class name="eg.Child">
<many-to-one name="parent" class="eg.Parent" not-null="true" insert="false" update="false" >
<column name="id" />
</many-to-one>
</class>



When I load Parent I want to load the children set, but when I want to
save Parent I don't want to save the children.
 
pascal betz
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
remove the cascade="all-delete-orphan" ?
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic