|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.module.core.MMTable
|
+--org.mmbase.module.core.MMObjectBuilder
|
+--org.mmbase.module.corebuilders.InsRel
InsRel, the main relation object, holds relations, and methods to handle them. An insrel defines a relation between two objects.
This class can be extended to create insrels that can also hold extra values and custom methods (named relations for example).
| Field Summary | |
java.lang.String |
classname
|
int |
relnumber
Hold the relnumber to use when creating a node of this builder. |
static boolean |
usesdir
|
| Fields inherited from class org.mmbase.module.core.MMObjectBuilder |
broadcastChanges, className, database, debug, description, descriptions, fields, NODE_MAX_SIZE, nodeCache, obj2type, OBJ2TYPE_MAX_SIZE, oType, replaceCache, searchAge, sortedDBLayout, TEMPNODE_DEFAULT_SIZE, TemporaryNodes, virtual |
| Fields inherited from class org.mmbase.module.core.MMTable |
mmb, tableName |
| Constructor Summary | |
InsRel()
empty constructor needed for autoload |
|
| Method Summary | |
void |
deleteRelationCache()
Deletes the Relation cache. |
void |
deleteRelationCache(int src)
Delete a specified relation from the relationCache |
java.util.Vector |
getAllRelationsVector(int src)
Get all relation(s) for a MMObjectNode This function returns all relations in which the node is either a source or the destination (even if the direction is unidirectional). |
int |
getGuessedNumber(java.lang.String name)
Search the relation definition table for the identifying number of a relation, by name. |
java.lang.String |
getGUIIndicator(java.lang.String field,
MMObjectNode node)
Get the display string for a given field of this node. |
java.util.Enumeration |
getRelated(int src,
int otype)
Get MMObjectNodes of a specified type related to a specified MMObjectNode |
java.util.Enumeration |
getRelated(int src,
int otype,
int rnumber)
Get MMObjectNodes of a specified type related to a specified MMObjectNode |
java.util.Enumeration |
getRelated(int src,
java.lang.String wtype)
get MMObjectNodes related to a specified MMObjectNode |
java.util.Enumeration |
getRelated(int src,
java.lang.String wtype,
java.lang.String role)
get MMObjectNodes related to a specified MMObjectNode |
java.util.Enumeration |
getRelated(java.lang.String sourceNode,
java.lang.String wtype)
get MMObjectNodes related to a specified MMObjectNode |
java.util.Enumeration |
getRelated(java.lang.String sourceNode,
java.lang.String wtype,
java.lang.String role)
get MMObjectNodes related to a specified MMObjectNode |
java.util.Vector |
getRelatedVector(int src,
int otype)
Get MMObjectNodes related to a specified MMObjectNode |
java.util.Vector |
getRelatedVector(int src,
int otype,
int rnumber)
Get MMObjectNodes related to a specified MMObjectNode |
MMObjectNode |
getRelation(int snumber,
int dnumber,
int rnumber)
Test whether a relation exists and returns the corresponding node. |
java.util.Enumeration |
getRelations(int src)
Get relation(s) for a MMObjectNode |
java.util.Enumeration |
getRelations(int src,
int rnumber)
Get relation(s) for a MMObjectNode, using a specified role (reldef) as a filter |
java.util.Enumeration |
getRelations(int src,
int otype,
int rnumber)
Get relations for a specified MMObjectNode |
java.util.Vector |
getRelationsVector(int src)
Get relation(s) for a MMObjectNode This function returns all relations in which the node is either a source, or where the node is the destination, but the direction is bidirectional. |
java.util.Vector |
getRelationsVector(int src,
int rnumber)
Get relation(s) for a MMObjectNode, using a specified role (reldef) as a filter This function returns all relations based on this role in which the node is either a source, or where the node is the destination, but the direction is bidirectional. |
boolean |
hasRelations(int src)
Checks whether any relations exist for a MMObjectNode. |
boolean |
init()
Initializes the builder. |
int |
insert(java.lang.String owner,
int snumber,
int dnumber,
int rnumber)
Deprecated. Use insert(String, MMObjectNode) instead. |
int |
insert(java.lang.String owner,
MMObjectNode node)
Insert a new Instance Relation. |
boolean |
reldefCorrect(int n1,
int n2,
int r)
Deprecated. Use TypeRel.reldefCorrect(int, int, int) instead |
void |
removeNode(MMObjectNode node)
Remove a node from the cloud. |
void |
setDefaults(MMObjectNode node)
Set defaults for a node. |
| Methods inherited from class org.mmbase.module.core.MMTable |
size |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
public static boolean usesdir
public java.lang.String classname
public int relnumber
| Constructor Detail |
public InsRel()
| Method Detail |
public boolean init()
dir field is defined (and thus whether directionality is supported).
If the field cannot be found, a "Warning: No dir field. Directionality support turned off." warning message is issued.init in class MMObjectBuilderboolean value, always success (true), as any exceptions are
caught and logged.usesdir
public int insert(java.lang.String owner,
int snumber,
int dnumber,
int rnumber)
owner - Administratorsnumber - Identifying number of the source objectdnumber - Identifying number of the destination objectrnumber - Identifying number of the relation defintitioninteger value identifying the newly inserted relation
public int insert(java.lang.String owner,
MMObjectNode node)
insert in class MMObjectBuilderowner - Administratornode - Relation node to addinteger value identifying the newly inserted relationpublic void removeNode(MMObjectNode node)
removeNode in class MMObjectBuildernode - The node to remove.public java.util.Enumeration getRelations(int src)
src - Identifying number of the object to find the relations of.Enumeration listing the relations.
If no relations exist, the method returns null.getRelationsVector(int)
public java.util.Enumeration getRelations(int src,
int rnumber)
src - Identifying number of the object to find the relations of.rnumber - The number of the relation definition (role) to filter onEnumeration listing the relations.
If no relations exist, the method returns null.getRelationsVector(int,int)
public java.util.Enumeration getRelations(int src,
int otype,
int rnumber)
src - this is the number of the MMObjectNode requesting the relationsotype - the object type of the nodes you want to have. -1 means any node.rnumber - Identifying number of the role (reldef)public boolean hasRelations(int src)
src - Identifying number of the object to find the relations of.true if any relations exist, false otherwise.public java.util.Vector getAllRelationsVector(int src)
src - Identifying number of the object to find the relations of.Vector containing the relations.
Each element in the vector's enumeration is a node object retrieved from the
associated table (i.e. 'insrel'), containing the node's fields.
If no relations exist (or a database exception occurs), the method returns null.public java.util.Vector getRelationsVector(int src)
src - Identifying number of the object to find the relations of.Vector containing the relations.
Each element in the vector's enumeration is a node object retrieved from the
associated table (i.e. 'insrel'), containing the node's fields.
If no relations exist (or a database exception occurs), the method returns null.
public java.util.Vector getRelationsVector(int src,
int rnumber)
src - Identifying number of the object to find the relations of.rnumber - The number of the relation definition (role) to filter onVector containing the relations.
Each element in the vector's enumeration is a node object retrieved from the
associated table (i.e. 'insrel'), containing the node's fields.
If no relations exist (or a database exception occurs), the method returns null.
public MMObjectNode getRelation(int snumber,
int dnumber,
int rnumber)
null.snumber - Identifying number of the source objectdnumber - Identifying number of the destination objectrnumber - Identifying number of the role (reldef)MMObjectNode if the exact relation exists,null otherwise
public java.util.Enumeration getRelated(java.lang.String sourceNode,
java.lang.String wtype)
sourceNode - this is the source MMObjectNodewtype - Specifies the type of the nodes you want to have e.g. wtype="pools"
public java.util.Enumeration getRelated(int src,
java.lang.String wtype)
src - this is the number of the source MMObjectNodewtype - Specifies the type of the nodes you want to have e.g. wtype="pools"
public java.util.Enumeration getRelated(int src,
int otype)
src - this is the number of the source MMObjectNodeotype - the object type of the nodes you want to have
public java.util.Enumeration getRelated(java.lang.String sourceNode,
java.lang.String wtype,
java.lang.String role)
sourceNode - this is the number of the source MMObjectNode (in string format)wtype - Specifies the type of the nodes you want to have e.g. wtype="pools"role - the role of teh relation (name in reldef)
public java.util.Enumeration getRelated(int src,
java.lang.String wtype,
java.lang.String role)
src - this is the number of the source MMObjectNodewtype - Specifies the type of the nodes you want to have e.g. wtype="pools"role - the role of teh relation (name in reldef)
public java.util.Enumeration getRelated(int src,
int otype,
int rnumber)
src - this is the number of the source MMObjectNodeotype - the object type of the nodes you want to havernumber - Identifying number of the role (reldef)
public java.util.Vector getRelatedVector(int src,
int otype)
src - this is the number of the MMObjectNode requesting the relationsotype - the object type of the nodes you want to have. -1 means any node.
public java.util.Vector getRelatedVector(int src,
int otype,
int rnumber)
src - this is the number of the MMObjectNode requesting the relationsotype - the object type of the nodes you want to have. -1 means any node.rnumber - Identifying number of the role (reldef)
public java.lang.String getGUIIndicator(java.lang.String field,
MMObjectNode node)
getGUIIndicator in class MMObjectBuilderfield - name of the field to describe.node - Node containing the field data.String describing the requested field's content
public boolean reldefCorrect(int n1,
int n2,
int r)
TypeRel.reldefCorrect(int, int, int) instead
n1 - Number of the source noden2 - Number of the destination noder - Number of the relation definitionboolean indicating success when the relation exists, failure if it does not.public void deleteRelationCache()
public void deleteRelationCache(int src)
src - the number of the relation to remove from the cachepublic int getGuessedNumber(java.lang.String name)
name - The name on which to search for the relationint value indicating the relation's object number, or -1 if not found.public void setDefaults(MMObjectNode node)
setDefaults in class MMObjectBuildernode - The node whose defaults to set.
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||