• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • Ron McLeod
  • paul wheaton
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
  • Devaka Cooray
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
  • Himai Minh
Bartenders:

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

 
Ranch Hand
Posts: 50
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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.
 
Ranch Hand
Posts: 547
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
remove the cascade="all-delete-orphan" ?
 
Don't get me started about those stupid light bulbs.
reply
    Bookmark Topic Watch Topic
  • New Topic