This week's book giveaway is in the Servlets forum.
We're giving away four copies of Murach's Java Servlets and JSP and have Joel Murach on-line!
See this thread for details.
The moose likes Blog around the Campfire and the fly likes Simple Hibernate Example with Transient (Non-Persistent) Data Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Murach's Java Servlets and JSP this week in the Servlets forum!
JavaRanch » Java Forums » Other » Blog around the Campfire
Bookmark "Simple Hibernate Example with Transient (Non-Persistent) Data" Watch "Simple Hibernate Example with Transient (Non-Persistent) Data" New topic
Author

Simple Hibernate Example with Transient (Non-Persistent) Data

Christopher Rygaard
Ranch Hand

Joined: Feb 22, 2014
Posts: 42
    
    3
This is the simplest stand-alone example of a Hibernate persistent object that contains non-persistent (transient) data.

This is very similar to my POJO example. The only substantive difference is the MyPersistentObject class now has an instance variable annotated with @Transient. That instance variable will not be written to persistence when the object is written.

Here is the persistent class with a transient field:

This is an example of how to use the persistent class:
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Simple Hibernate Example with Transient (Non-Persistent) Data
 
Similar Threads
Simple Hibernate Container Example
Simple Hibernate Example with Final Classes and Final Methods
Simple Hibernate Cascade Save Example
Simple Hibernate POJO example
Simple Hibernate Example with Enums