The first thing to decide when implementing your persistence layer is which classes are to be
persisted.
Let's take a sample class (
Hotel
) as an example
We can define a class as persistable using either annotations in the class, or XML metadata.

With JDO persistence all classes that are persisted have to be identified in XML or annotations as
shown above. In addition, if any of your other classes
access the fields of these persistable
classes directly
then these other classes should be defined as
PersistenceAware
.
You do this as follows