Represents the identity of an object.
It's composed of:
class of the real object
top-level class of the real object (could be an abstract class or interface or the
class of the object itself), used to make an object unique across extent classes
an array of all primary key value objects
a flag which indicates whether this is a transient Identity
(identity of a non-persistent, "new" object) or a persistent Identity (identity object
of a persistent, "already written to datastore" object).
To create Identity objects it's strongly recommended to use the
IdentityFactory , because
in future releases of OJB the Identity constructors will be no longer reachable or forbidden to use.
NOTE: An Identity object must be unique
accross extents.
Builds
org.apache.ojb.broker.Identity objects to identify persistence capable objects within OJB.
In many cases the primary key (based on metadata declaration) of an object is known
and the whole object should be materialized (e.g.
Test case for checking the management of references, handling of PK used as FK too.
In this test the PK of
org.apache.ojb.broker.PrimaryKeyForeignKeyTest.Person is a FK to
org.apache.ojb.broker.PrimaryKeyForeignKeyTest.PersonDetail too.
Person has a reference to PersonDetail, the PK of Person is the FK to PersonDetail too!!
PersonDetail PK is not autoincremented we have to set the PK of Person
NOTE: Don't change metadata in production environments in such a way.