org.mmbase.bridge.implementation
Class BasicRelation

java.lang.Object
  extended by org.mmbase.bridge.util.AbstractNode
      extended by org.mmbase.bridge.implementation.BasicNode
          extended by org.mmbase.bridge.implementation.BasicRelation
All Implemented Interfaces:
Comparable<Node>, Node, Relation, SizeMeasurable

public class BasicRelation
extends BasicNode
implements Relation

Version:
$Id: BasicRelation.java 41570 2010-03-23 10:34:47Z michiel $
Author:
Rob Vermeulen, Pierre van Rooden
Javadoc:

Field Summary
protected  int dnum
           
protected  boolean relationChanged
           
protected  int snum
           
 
Fields inherited from class org.mmbase.bridge.implementation.BasicNode
cloud, nodeManager, noderef, originalNoderef, temporaryNodeId
 
Fields inherited from interface org.mmbase.bridge.Node
CLOUD_COMMITNODE_KEY
 
Constructor Summary
BasicRelation(MMObjectNode node, BasicCloud cloud)
           
BasicRelation(MMObjectNode node, BasicCloud cloud, int id)
           
BasicRelation(MMObjectNode node, BasicRelationManager nodeManager)
           
 
Method Summary
(package private)  void checkValid()
           
 void commit()
          Commit the node to the database.
 Node getDestination()
          Retrieves the destination of the relation
 RelationManager getRelationManager()
          Retrieves the RelationManager used
 Node getSource()
          Retrieves the source of the relation
protected  void init()
          Initializes the node.
 boolean isRelation()
          Determine whether this Node is a Relation.
 void setDestination(Node node)
          set the destination of the relation
 void setSource(Node node)
          set the source of the relation
 void setValueWithoutProcess(String fieldName, Object value)
          Like setObjectValue, but without processing, this is called by the other set-values.
 Relation toRelation()
          Returns this as a Relation.
 
Methods inherited from class org.mmbase.bridge.implementation.BasicNode
cancel, checkAccount, checkCommit, checkCreate, checkDelete, checkWrite, countRelatedNodes, countRelatedNodes, createAlias, createFunctionValue, createParameters, delete, deleteAlias, deleteRelations, finalize, getAliases, getBooleanValue, getByteSize, getByteSize, getByteValue, getChanged, getCloud, getContext, getDateValue, getDoubleValue, getFloatValue, getFunctions, getInputStreamValue, getIntValue, getListValue, getLongValue, getNode, getNodeFunction, getNodeManager, getNodeValue, getNumber, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getSize, getStringValue, getValueWithoutProcess, getXMLValue, hasRelations, invalidateNode, isChanged, isChanged, isNew, isNull, mayChangeContext, mayDelete, mayWrite, setContext, setNode, setNodeManager, setNodeManager, setSize, setValueWithoutChecks, toNodeNumber, toString
 
Methods inherited from class org.mmbase.bridge.util.AbstractNode
compareTo, countRelations, countRelations, createRelation, delete, deleteRelations, equals, getDecimalValue, getFieldValue, getFieldValue, getFunction, getFunctionMap, getFunctionValue, getObjectValue, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getValue, getXMLValue, hashCode, isNodeManager, isRelationManager, processNull, setBooleanValue, setByteValue, setDateValue, setDecimalValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeValue, setObjectValue, setStringValue, setValue, setXMLValue, toNodeManager, toRelationManager, validate
 
Methods inherited from class java.lang.Object
clone, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.bridge.Node
cancel, countRelatedNodes, countRelatedNodes, countRelations, countRelations, createAlias, createParameters, createRelation, delete, delete, deleteAlias, deleteRelations, deleteRelations, getAliases, getBooleanValue, getByteValue, getChanged, getCloud, getContext, getDateValue, getDecimalValue, getDoubleValue, getFieldValue, getFieldValue, getFloatValue, getFunction, getFunctions, getFunctionValue, getInputStreamValue, getIntValue, getListValue, getLongValue, getNodeManager, getNodeValue, getNumber, getObjectValue, getPossibleContexts, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelatedNodes, getRelations, getRelations, getRelations, getRelations, getRelations, getSize, getStringValue, getValue, getValueWithoutProcess, getXMLValue, getXMLValue, hasRelations, isChanged, isChanged, isNew, isNodeManager, isNull, isRelationManager, mayChangeContext, mayDelete, mayWrite, setBooleanValue, setByteValue, setContext, setDateValue, setDecimalValue, setDoubleValue, setFloatValue, setInputStreamValue, setIntValue, setListValue, setLongValue, setNodeManager, setNodeValue, setObjectValue, setStringValue, setValue, setXMLValue, toNodeManager, toRelationManager, toString, validate
 
Methods inherited from interface java.lang.Comparable
compareTo
 

Field Detail

snum

protected int snum

dnum

protected int dnum

relationChanged

protected boolean relationChanged
Constructor Detail

BasicRelation

BasicRelation(MMObjectNode node,
              BasicCloud cloud)
Javadoc:

BasicRelation

BasicRelation(MMObjectNode node,
              BasicRelationManager nodeManager)
Javadoc:

BasicRelation

BasicRelation(MMObjectNode node,
              BasicCloud cloud,
              int id)
Javadoc:
Method Detail

isRelation

public final boolean isRelation()
Description copied from interface: Node
Determine whether this Node is a Relation.

Specified by:
isRelation in interface Node
Overrides:
isRelation in class AbstractNode
Returns:
true if this Node is a Relation.

toRelation

public Relation toRelation()
Description copied from interface: Node
Returns this as a Relation.

Specified by:
toRelation in interface Node
Overrides:
toRelation in class AbstractNode
Returns:
a Relation object

init

protected void init()
Initializes the node. Determines nodemanager and cloud (depending on information available), Sets references to MMBase modules and initializes state in case of a transaction.

Overrides:
init in class BasicNode

getSource

public Node getSource()
Description copied from interface: Relation
Retrieves the source of the relation

Specified by:
getSource in interface Relation
Returns:
the source node

getDestination

public Node getDestination()
Description copied from interface: Relation
Retrieves the destination of the relation

Specified by:
getDestination in interface Relation
Returns:
the destination node

setSource

public void setSource(Node node)
Description copied from interface: Relation
set the source of the relation

Specified by:
setSource in interface Relation
Parameters:
node - the source node

setDestination

public void setDestination(Node node)
Description copied from interface: Relation
set the destination of the relation

Specified by:
setDestination in interface Relation
Parameters:
node - the destination node

getRelationManager

public RelationManager getRelationManager()
Description copied from interface: Relation
Retrieves the RelationManager used

Specified by:
getRelationManager in interface Relation
Returns:
the RelationManager

checkValid

void checkValid()
Javadoc:

setValueWithoutProcess

public void setValueWithoutProcess(String fieldName,
                                   Object value)
Description copied from class: AbstractNode
Like setObjectValue, but without processing, this is called by the other set-values.

Specified by:
setValueWithoutProcess in interface Node
Overrides:
setValueWithoutProcess in class AbstractNode
Parameters:
fieldName - name of field
value - new value of the field

commit

public void commit()
Description copied from class: BasicNode
Commit the node to the database. Prior to committing, the values are processed by any commit-processors associated with the datatype of the node's fields), then validated. Makes this node and/or the changes made to this node visible to the cloud. If this method is called for the first time on this node it will make this node visible to the cloud, otherwise the modifications made to this node using the set methods will be made visible to the cloud. This action fails if the current node is not in edit mode. If the node is in a transaction, nothing happens - actual committing occurs through the transaction. This implementation checks create rights, then validates the values, then processes the 'commit processors' and then calls BasicCloud.afterCommit(BasicNode)

Specified by:
commit in interface Node
Overrides:
commit in class BasicNode


MMBase 2.0-SNAPSHOT - null