|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
public interface IdentityFactory
Builds 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 Identity
objects based on
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).
Method Summary | |
---|---|
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. |
Identity |
buildIdentity(Class realClass,
Class topLevelClass,
String[] pkFieldName,
Object[] pkValues)
Build a unique Identity
for the given primary key values (composite PK's) of a
persistence capable object. |
Identity |
buildIdentity(ClassDescriptor cld,
Object obj)
Build a unique Identity for the given
persistence capable object. |
Identity |
buildIdentity(Class realClass,
Object pkValue)
Convenience method for persistent objects with single primary key. |
Identity |
buildIdentity(Class realClass,
String[] pkFieldName,
Object[] pkValues)
Convenience shortcut method for buildIdentity(java.lang.Class, java.lang.Class, java.lang.String[], java.lang.Object[]) . |
Identity |
buildIdentity(Object obj)
Build a unique Identity for the given
persistence capable object. |
Method Detail |
---|
Identity buildIdentity(Object obj)
Identity
for the given
persistence capable object.
obj
- The object to build the Identity
for
Identity buildIdentity(ClassDescriptor cld, Object obj)
Identity
for the given
persistence capable object.
cld
- The ClassDescriptor
of the objectobj
- The object to build the Identity
for
Identity buildIdentity(Class realClass, Class topLevelClass, String[] pkFieldName, Object[] pkValues)
Identity
for the given primary key values (composite PK's) of a
persistence capable object.
realClass
- The class of the associated objecttopLevelClass
- The top-level class of the associated objectpkFieldName
- The field names of the PK fieldspkValues
- The PK values
Identity buildIdentity(Class realClass, String[] pkFieldName, Object[] pkValues)
buildIdentity(java.lang.Class, java.lang.Class, java.lang.String[], java.lang.Object[])
.
realClass
- The class of the associated objectpkFieldName
- The field names of the PK fieldspkValues
- The PK values
Identity buildIdentity(Class realClass, Object pkValue)
realClass
- The class of the associated objectpkValue
- The PK value
buildIdentity(java.lang.Class, java.lang.String[], java.lang.Object[])
Identity buildIdentity(Class realClass, Class topLevelClass, Object[] pkValues)
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 FieldDescriptor
in the mapping file.
realClass
- The class of the associated objecttopLevelClass
- The top-level class of the associated objectpkValues
- The PK values
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |