|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.ashridgetech.prevdb.client.Ref
A reference from one persistent object to another. Holds only the oid of the referenced object until it is accessed, when it finds the object by looking it up in the extent of the referenced type. Immutable - a new object must be created if the reference changes.
Constructor Summary | |
Ref()
Creates new null Ref that refers to no object. |
|
Ref(Persistent object)
Creates new Ref referring to a Persistent object. |
|
Ref(Persistent container,
Class persistentClass,
Object oid)
Creates new Ref with the oid of a Persistent object. |
|
Ref(PersistentManager manager,
Object oid)
Creates new Ref with the oid of a Persistent object. |
Method Summary | |
boolean |
equals(Object o)
|
Persistent |
get()
Get the object referenced by this Ref . |
Object |
getOid()
Get the oid of the object referenced by this Ref . |
int |
hashCode()
|
boolean |
isNull()
Indicate whether this ref is null (ie does not refer to an object) |
String |
toString()
|
Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
Constructor Detail |
public Ref()
Ref
that refers to no object.
public Ref(Persistent object)
Ref
referring to a Persistent
object.
object
- the Persistent
to which the new Ref
will refer - may be nullpublic Ref(Persistent container, Class persistentClass, Object oid)
Ref
with the oid
of a Persistent
object.
Assumes the reference is to an object managed by the PersistentManager
for persistentClass
within the PrevDb
to which container
belongs
container
- the object that contains this Ref
persistentClass
- the class of object to which this Ref
refersoid
- the oid of Persistent
to which the new Ref
will refer -
NOT the Persistent
itself
IllegalArgumentException
- if a Persistent
is passed to oid
public Ref(PersistentManager manager, Object oid)
Ref
with the oid
of a Persistent
object.
manager
- the manager of the class of object to which this Ref
refers - may be null if oid
is nulloid
- the oid of Persistent
to which the new Ref
will referMethod Detail |
public Object getOid()
Ref
.
public Persistent get()
Ref
.
public boolean isNull()
ref
is null (ie does not refer to an object)
public boolean equals(Object o)
equals
in class Object
public int hashCode()
hashCode
in class Object
public String toString()
toString
in class Object
|
|||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |