| org.apache.ojb.broker.IdentityFactory
All known Subclasses: org.apache.ojb.broker.core.IdentityFactoryImpl,
IdentityFactory | public interface IdentityFactory (Code) | | 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. findByPrimaryKey(...) calls).
This class make available a bunch of methods help to create
org.apache.ojb.broker.Identity objects based on
- the persistence capable object itself
- the primary key values of a persistence capable object
NOTE:
It is possible to create transient
Identity objects for transient,
"new created" persistence capable objects. But keep in mind that this transient
Identity object is only valid till the persistence capable object was written
to datastore. After this the
Identity have to be renewed by calling
IdentityFactory.buildIdentity(...) again (then the transient Identity
will be replaced by the persistent Identity).
version: $Id: IdentityFactory.java,v 1.2.2.4 2005/12/21 22:22:08 tomdz Exp $ |
Method Summary | |
Identity | buildIdentity(Object obj) Build a unique
org.apache.ojb.broker.Identity for the given
persistence capable object. | Identity | buildIdentity(ClassDescriptor cld, Object obj) Build a unique
org.apache.ojb.broker.Identity for the given
persistence capable object. | Identity | buildIdentity(Class realClass, Class topLevelClass, String[] pkFieldName, Object[] pkValues) Build a unique
org.apache.ojb.broker.Identity for the given primary key values (composite PK's) of a
persistence capable object. | Identity | buildIdentity(Class realClass, String[] pkFieldName, Object[] pkValues) Convenience shortcut method for
IdentityFactory.buildIdentity(java.lang.Class,java.lang.Class,java.lang.String[],java.lang.Object[]) . | Identity | buildIdentity(Class realClass, Object pkValue) Convenience method for persistent objects with single primary key. | Identity | buildIdentity(Class realClass, Class topLevelClass, Object[] pkValues) Create a new
Identity object based on given arguments - NOTE: There
will be no check to resolve the order of the PK values. |
buildIdentity | Identity buildIdentity(Class realClass, Class topLevelClass, String[] pkFieldName, Object[] pkValues)(Code) | | Build a unique
org.apache.ojb.broker.Identity for the given primary key values (composite PK's) of a
persistence capable object.
Parameters: realClass - The class of the associated object Parameters: topLevelClass - The top-level class of the associated object Parameters: pkFieldName - The field names of the PK fields Parameters: pkValues - The PK values The new Identity object |
buildIdentity | Identity buildIdentity(Class realClass, Class topLevelClass, Object[] pkValues)(Code) | | Create a new
Identity object based on given arguments - NOTE: There
will be no check to resolve the order of the PK values. This method expect
the correct order based on the declaration of the
org.apache.ojb.broker.metadata.FieldDescriptor in the mapping file.
Parameters: realClass - The class of the associated object Parameters: topLevelClass - The top-level class of the associated object Parameters: pkValues - The PK values The new Identity object |
|
|