|
||||||||||
| 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
public class 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,
Serialized Form| Field Summary |
|---|
| Fields inherited from class org.mmbase.module.core.MMObjectNode |
|---|
aliases, initializing, isNew, oldBuilder, parent, sequence, VALUE_SHORTED, values |
| Constructor Summary | |
|---|---|
ClusterNode(ClusterBuilder parent)
Main contructor. |
|
ClusterNode(ClusterBuilder 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 String |
getBuilderName(String fieldName)
Determines the builder name of a specified fieldname, i.e. |
byte[] |
getByteValue(String fieldName)
Get a binary value of a certain field. |
MMObjectNode |
getRealNode(String builderName)
Obtain the 'real' nodes, associated with a specified objectbuilder. |
Enumeration<MMObjectNode> |
getRelations()
Return the relations of this node. |
long |
getSize(String fieldName)
Returns the size (in byte) of the given field. |
String |
getStringValue(String fieldName)
Get a value of a certain field. |
Object |
getValue(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(String fieldName,
Object fieldValue)
Sets a key/value pair in the main values of this node. |
void |
storeValue(String fieldName,
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 |
|---|
checkFieldExistance, getAge, getOType, getRelationCount, getRelationCount, hasRelations, insert, isVirtual |
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ClusterNode(ClusterBuilder parent)
parent - the node's parent
public ClusterNode(ClusterBuilder parent,
int nrofnodes)
parent - the node's parentnrofnodes - Nr of referenced nodes.| 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(String builderName)
builderName - the name of the builder of the requested node, as known
within the virtual node
null if it does not exist or is unknown
public void storeValue(String fieldName,
Object fieldValue)
storeValue in class MMObjectNodefieldName - the name of the field to changefieldValue - the value to assign
public boolean setValue(String fieldName,
Object fieldValue)
setValue in class MMObjectNodefieldName - the name of the field to changefieldValue - the value to assign
trueprotected String getBuilderName(String fieldName)
fieldName - the name of the field
public MMObjectBuilder getBuilder()
MMObjectNode
getBuilder in class MMObjectNodepublic Object getValue(String fieldName)
getValue in class MMObjectNodefieldName - the name of the field who's data to return
Objectpublic long getSize(String fieldName)
MMObjectNode
getSize in class MMObjectNodepublic String getStringValue(String fieldName)
getStringValue in class MMObjectNodefieldName - the name of the field who's data to return
Stringpublic byte[] getByteValue(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 Enumeration<MMObjectNode> getRelations()
getRelations in class VirtualNodeEnumeration
RuntimeException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||