|
Objectivity for Java Reference | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.objy.db.app.ToManyRelationship
Represents a to-many relationship on a class.
The class on which a to-many relationship is being defined must declare a non-static relationship field of type ToManyRelationship. Objectivity for Java initializes this field with an object that will support the relationship services at runtime.
Defining a relationship makes it possible to relate objects. You use the methods defined on this class to actually create and access relationships between objects.
For additional information, see Relationships.
The ToOneRelationship class represents a to-one relationship.
Functionality | |
Adding and Deleting Relationships | add(Object) remove(Object) clear() |
Testing | includes(Object) exists() |
Finding Related Objects | scan() scan(String) |
Method Summary | |
void |
add(Object object)
Adds a relationship between this object and the specified object. |
void |
clear()
Removes all relationships with this object. |
boolean |
exists()
Tests whether any objects are related to this object. |
boolean |
includes(Object object)
Tests whether this object is related to the specified object. |
void |
remove(Object object)
Removes a relationship between this object and the specified object. |
Iterator |
scan()
Initializes an iterator to find all objects related to this object. |
Iterator |
scan(String predicate)
Initializes an iterator to find all objects related to this object that satisfy the specified predicate. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Method Detail |
public void add(Object object)
object
- The object being added to the relationship.
If object is transient, this method makes it
persistent.
If object is null, this method is equivalent to
clear.public void remove(Object object)
This method throws an ObjyRuntimeException if the specified object is not related by this relationship.
object
- The object with which the relationship exists.public void clear()
public boolean includes(Object object)
object
- The object whose relationship is
being tested.public boolean exists()
public Iterator scan()
public Iterator scan(String predicate)
If predicate-scan autoflush is enabled for the connection object, this method will flush any modified objects to the federated database before performing the scan. Otherwise, the result of the scan may contain out-of-date information.
predicate
- The condition that each retrieved object must
satisfy, expressed in the Objectivity/DB
predicate query language.Connection.setPredicateScanAutoFlush(boolean)
,
Connection.isPredicateScanAutoFlush()
|
Objectivity for Java Reference | |||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Copyright © 2000 Objectivity, Inc. All rights reserved.