This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
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: