|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.ojb.broker.Identity
public class Identity
Represents the identity of an object.
It's composed of:
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. Means all objects with the same top-level class need unique PK values.
IdentityFactory
,
Serialized FormConstructor Summary | |
---|---|
Identity(java.lang.Class realClass,
java.lang.Class topLevel,
java.lang.Object[] pkValues)
For internal use only! Creates an Identity from a class and the objects primary key values. |
|
Identity(java.lang.Class realClass,
java.lang.Class topLevel,
java.lang.Object[] pkValues,
boolean isTransient)
For internal use only!. |
|
Identity(java.lang.Object objectToIdentitify,
PersistenceBroker targetBroker)
Constructor for internal use. |
|
Identity(java.lang.Object objectToIdentitify,
PersistenceBroker targetBroker,
ClassDescriptor cld)
Constructor for internal use. |
Method Summary | |
---|---|
boolean |
equals(java.lang.Object obj)
|
static Identity |
fromByteArray(byte[] anArray)
Deprecated. |
java.lang.Class |
getObjectsRealClass()
Return the "real" class of the real subject. |
java.lang.Class |
getObjectsTopLevelClass()
Returns the top-level class of the real subject (base class, base interface denoted in the repository or objects real class if no top-level was found). |
java.lang.Object[] |
getPrimaryKeyValues()
Returns the primary key values of the real subject. |
int |
hashCode()
|
boolean |
isTransient()
Determines whether the identity is transient. |
byte[] |
serialize()
Deprecated. |
void |
setObjectsRealClass(java.lang.Class objectsRealClass)
Set the real class of the subject. |
java.lang.String |
toString()
return a String representation. |
Methods inherited from class java.lang.Object |
---|
getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public Identity(java.lang.Class realClass, java.lang.Class topLevel, java.lang.Object[] pkValues, boolean isTransient)
IdentityFactory
to create object identity.
realClass
- the concrete class of the object, or null if not known.topLevel
- the highest persistence-capable class or
interface (in the inheritance hierarchy) that the identified object is an instance ofpkValues
- (unique across the extents !)isTransient
- If truepublic Identity(java.lang.Class realClass, java.lang.Class topLevel, java.lang.Object[] pkValues)
IdentityFactory
to create object identity.
realClass
- the concrete class of the object, or null if not known.topLevel
- the highest persistence-capable class or
interface (in the inheritance hierarchy) that the identified object is an instance ofpkValues
- (unique across the extents !)public Identity(java.lang.Object objectToIdentitify, PersistenceBroker targetBroker)
IdentityFactory
to create an object identity.
objectToIdentitify
- The object for which to create the identitytargetBroker
- The persistence brokerpublic Identity(java.lang.Object objectToIdentitify, PersistenceBroker targetBroker, ClassDescriptor cld)
IdentityFactory
to create an object identity.
objectToIdentitify
- The object for which to create the identitytargetBroker
- The persistence brokercld
- The class descriptorMethod Detail |
---|
public static Identity fromByteArray(byte[] anArray) throws PersistenceBrokerException
anArray
- The serialized representation
PersistenceBrokerException
#serialize}.
public boolean isTransient()
true
if the identity is transientpublic java.lang.Class getObjectsTopLevelClass()
public java.lang.Class getObjectsRealClass()
public void setObjectsRealClass(java.lang.Class objectsRealClass)
objectsRealClass
- The real classpublic byte[] serialize() throws PersistenceBrokerException
PersistenceBrokerException
fromByteArray(byte[])
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.Object[] getPrimaryKeyValues()
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |