Granny's Programming Pearls
"inside of every large program is a small program struggling to get out"
JavaRanch.com/granny.jsp
The moose likes Blog around the Campfire and the fly likes Simple Hibernate Cascade Save Example Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
JavaRanch » Java Forums » Other » Blog around the Campfire
Bookmark "Simple Hibernate Cascade Save Example" Watch "Simple Hibernate Cascade Save Example" New topic
Author

Simple Hibernate Cascade Save Example

Christopher Rygaard
Ranch Hand

Joined: Feb 22, 2014
Posts: 42
    
    3
Cascade Saving Example

This is the simplest way to illustrate cascade saving that I could cook up.

These persistent classes are nearly identical to those in the container example I posted earlier. The only difference is the annotation on Container._children.

The bit that illustrates the cascading saving is in HibernateExample.makeContents().

Notice: This is provided with no warranty whatsoever. Use at your own risk.

This is the contained class:

This is the container class:

This illustrates cascade saving:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Hibernate Cascade Save Example
 
Similar Threads
Simple Hibernate Container Example
Simple Hibernate Eager Loading Example
Simple Hibernate Lazy Loading Example
One class whose instances are contained in multiple other classes.
Simple Hibernate POJO example