|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.module.core.MMObjectNode
org.mmbase.module.core.VirtualNode
org.mmbase.module.core.ClusterNode
ClusterNode combines fields of different nodes in a single "virtual" node.
This corresponds to the way that an SQL "join" select statement combines
fields of different tables in result rows.
The individual fields are retrieved from a set of related nodes using a multilevel query, i.e. a query joining tables using the relations between the tables.
This class overrides a number of methods, allowing direct access to data in
the nodes which form the 'virtual' node.
In future releases, data will NOT be stored directkly in this node anymore.
Instead, it will be stored in the underlying MMObjectNodes.
For reasons of optiomalization, however, we cannot do this right now.
MMObjectNode will need a status field that allows us to recognize whether
it is fully loaded, partially loaded, or being edited.
This can then be checked in 'retrievevalue'.
In addition, to prevent caching conflicts, nodes will need to maintain
their references. This allows for a secure caching mechanism.
Among other things, this allows one to change values in a multilevel node,
or to access functionality that would otherwise be restricted to 'real'
nodes.
ClusterBuilder| Field Summary | |
protected java.util.Hashtable |
nodes
Holds the name - value pairs of related nodes in this virtual node. |
| Fields inherited from class org.mmbase.module.core.MMObjectNode |
alias, changed, initializing, parent, prefix, properties, relatedCache, relationsCache, VALUE_NULL, values, virtual |
| Constructor Summary | |
ClusterNode(MMObjectBuilder parent)
Main contructor. |
|
ClusterNode(MMObjectBuilder parent,
int nrofnodes)
Main contructor. |
|
| Method Summary | |
boolean |
commit()
commit : commits the node to the database or other storage system. |
MMObjectBuilder |
getBuilder()
Returns the actual builder of the node. |
protected java.lang.String |
getBuilderName(java.lang.String fieldName)
Determines the builder name of a specified fieldname, i.e. |
byte[] |
getByteValue(java.lang.String fieldName)
Get a binary value of a certain field. |
MMObjectNode |
getRealNode(java.lang.String builderName)
Obtain the 'real' nodes, associated with a specified objectbuilder. |
java.util.Enumeration |
getRelations()
Return the relations of this node. |
java.lang.String |
getStringValue(java.lang.String fieldName)
Get a value of a certain field. |
java.lang.Object |
getValue(java.lang.String fieldName)
Get a value of a certain field. |
boolean |
isChanged()
Tests whether one of the values of this node was changed since the last commit/insert. |
boolean |
setValue(java.lang.String fieldName,
java.lang.Object fieldValue)
Sets a key/value pair in the main values of this node. |
void |
storeValue(java.lang.String fieldName,
java.lang.Object fieldValue)
Stores a value in the values hashtable. |
void |
testValidData()
Tests whether the data in a node is valid (throws an exception if this is not the case). |
| Methods inherited from class org.mmbase.module.core.VirtualNode |
getAge, getRelationCount, getRelationCount, hasRelations, insert |
| Methods inherited from class java.lang.Object |
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.Hashtable nodes
| Constructor Detail |
public ClusterNode(MMObjectBuilder parent)
parent - the node's parent, generally an instance of the ClusterBuilder builder.
public ClusterNode(MMObjectBuilder parent,
int nrofnodes)
parent - the node's parent, generally an instance of the ClusterBuilder builder.| Method Detail |
public void testValidData()
throws InvalidDataException
testValidData in class MMObjectNodeInvalidDataException - If the data was unrecoverably invalid
(the references did not point to existing objects)public boolean commit()
commit in class VirtualNodetrue if the commit was succesfull, false is it failedpublic MMObjectNode getRealNode(java.lang.String builderName)
null if it does not exist or is unknown
public void storeValue(java.lang.String fieldName,
java.lang.Object fieldValue)
storeValue in class MMObjectNodefieldValue - the value to assignfieldName - the name of the field to change
public boolean setValue(java.lang.String fieldName,
java.lang.Object fieldValue)
setValue in class MMObjectNodefieldValue - the value to assignfieldName - the name of the field to change
trueprotected java.lang.String getBuilderName(java.lang.String fieldName)
public MMObjectBuilder getBuilder()
MMObjectNode
getBuilder in class MMObjectNodepublic java.lang.Object getValue(java.lang.String fieldName)
getValue in class MMObjectNodefieldName - the name of the field who's data to return
Objectpublic java.lang.String getStringValue(java.lang.String fieldName)
getStringValue in class MMObjectNodefieldName - the name of the field who's data to return
Stringpublic byte[] getByteValue(java.lang.String fieldName)
getByteValue in class MMObjectNodefieldName - the name of the field who's data to return
byte [] (binary/blob field)public boolean isChanged()
isChanged in class MMObjectNodetrue if changes have been made, false otherwisepublic java.util.Enumeration getRelations()
getRelations in class VirtualNodeEnumeration
RuntimeException
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||