File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Simple Hibernate Example with Transient (Non-Persistent) Data

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