Fast Object Database for Java - with JPA/JDO support

JDO Predefined ID Classes

An object ID is a combination of a persistence capable class and a primary key. It provides a unique representation of a persistent object.

The following classes serve as predefined ID classes for persistence capable classes with a simple single field primary key:

Object IDs are used in many PersistenceManagerjavax.jdo.PersistenceManagerJDO interfacePersistenceManager is the primary interface for JDO-aware application components.See JavaDoc Reference Page... methods (getObjectId, getObjectById, getObjectByIds, etc.) to represent objects but should not be used as the type of a primary key field in a persistence capable class.

For example, to use a String primary key define a primary key field of type String:

@PersistenceCapablejavax.jdo.annotations.PersistenceCapableJDO annotationAnnotation for whether the class or interface is persistence-capable.See JavaDoc Reference Page...
public class MyClass {
    @PrimaryKeyjavax.jdo.annotations.PrimaryKeyJDO annotationAnnotation on a member to define it as a primary key member of a class or
 persistent interface using application identity.See JavaDoc Reference Page... String id;

Persistent objects with a String primary key (including instances of MyClass) can be represented uniquely by StringIdentity, as a combination of a class and a string value.