JDO provides a means of transparent persistence of objects of user defined classes. With JDO there are actually 3 types of classes.

  • Persistence Capable classes are classes whose instances can be persisted to a datastore. JDO provide the mechanism for persisting these instances, and they are core to JDO. These classes need to be enhanced according to a JDO Meta-Data specification before use within a JDO environment.

  • Persistence Aware classes are classes that manipulate PersistenceCapable instances through direct attribute manipulation. These classes are typically enhanced with very minimal JDO Meta-Data. The enhancement process performs very little changes to these classes.

  • Normal classes are classes that aren’t themselves persistable, and have no knowledge of persistence either. These classes are totally unchanged in JDO, and require no JDO Meta-Data whatsoever.

PersistenceCapable

Classes are defined as PersistenceCapable, either by XML MetaData, like this

  1. <class name="MyClass">
  2. ...
  3. </class>

or using Annotations, like this

  1. @PersistenceCapable
  2. public class MyClass
  3. {
  4. ...
  5. }

PersistenceAware

Classes are defined as PersistenceAware either by XML MetaData, like this

  1. <class name="MyClass" persistence-modifier="persistence-aware"/>

or using Annotations, like this

  1. @PersistenceAware
  2. public class MyClass
  3. {
  4. ...
  5. }