Win a copy of The Business Blockchain this week in the Cloud forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple Hibernate Cascade Save Example

 
Christopher Rygaard
Ranch Hand
Posts: 42
3
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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:
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic