| java.lang.Object org.mmbase.util.functions.FunctionProvider org.mmbase.module.core.MMTable
All known Subclasses: org.mmbase.module.core.MMObjectBuilder,
MMTable | abstract public class MMTable extends FunctionProvider (Code) | | MMTable is the base abstraction of a cloud of objects stored in one database table,
essentially a cloud of objects of the same type.
It provides a starting point for MMObjectBuilder by defining a scope - the database table -
and basic functionality to create the table and query properties such as its size.
This class does not contain actual management of nodes (this is left to MMOBjectBuilder).
author: Daniel Ockeloen author: Pierre van Rooden (javadoc) version: $Id: MMTable.java,v 1.27 2007/02/11 14:46:13 nklasens Exp $ |
Constructor Summary | |
public | MMTable() Empty constructor. |
Method Summary | |
public int | count(String where) Counts number of nodes matching a specified constraint.
Parameters: where - The constraint, can be a SQL where-clause, a MMNODEexpression or an altavista-formatted expression. | public int | count(NodeSearchQuery query) Counts number of nodes matching a specified constraint.
The constraint is specified by a query that selects nodes of
a specified type, which must be the nodetype corresponding
to this builder.
Parameters: query - The query. | public boolean | created() Check whether the table is accessible.
In general, this means the table does not exist. | public String | getFullTableName() | public MMBase | getMMBase() | public MMObjectNode | getNode(int number, boolean useCache) Retrieves a node based on it's number (a unique key).
Parameters: number - The number of the node to search for Parameters: useCache - If true, the node is retrieved from the node cache if possible. | public int | getNodeType(int number) Retrieves an object's type. | protected List<MMObjectNode> | getNodes(Collection<MMObjectNode> virtuals) Convert virtual nodes to real nodes based on their otype
Normally a multirelations-search will return virtual nodes. | public List<MMObjectNode> | getNodes(NodeSearchQuery query) Returns nodes matching a specified constraint.
The constraint is specified by a query that selects nodes of
a specified type, which must be the nodetype corresponding
to this builder.
Parameters: query - The query. | public List<MMObjectNode> | getNodes() Returns all the nodes from the builder. | public StorageConnector | getStorageConnector() | public String | getTableName() | public Enumeration<MMObjectNode> | search(String where) | public Vector<MMObjectNode> | searchVector(String where) | public void | setMMBase(MMBase m) Set the MMBase object, and retrieve the storage layer. | public void | setTableName(String tableName) Set tablename of the builder. | public int | size() Determine the number of objects in this table. |
maxNodesFromQuery | protected int maxNodesFromQuery(Code) | | Maximum number of nodes to return on a query (-1 means no limit, and is also the default)
|
mmb | protected MMBase mmb(Code) | | The MMBase module that this table belongs to
|
MMTable | public MMTable()(Code) | | Empty constructor.
|
count | public int count(String where)(Code) | | Counts number of nodes matching a specified constraint.
Parameters: where - The constraint, can be a SQL where-clause, a MMNODEexpression or an altavista-formatted expression. The number of nodes, or -1 when failing to retrieve the data.MMTable.count(NodeSearchQuery) count(NodeSearchQuery) |
count | public int count(NodeSearchQuery query) throws SearchQueryException(Code) | | Counts number of nodes matching a specified constraint.
The constraint is specified by a query that selects nodes of
a specified type, which must be the nodetype corresponding
to this builder.
Parameters: query - The query. The number of nodes. throws: IllegalArgumentException - when an invalid argument is supplied. throws: SearchQueryException - when failing to retrieve the data. since: MMBase-1.7 |
created | public boolean created()(Code) | | Check whether the table is accessible.
In general, this means the table does not exist. Please note that this routine may
also return false if the table is inaccessible due to insufficient rights.
true if the table is accessible, false otherwise. |
getFullTableName | public String getFullTableName()(Code) | | Retrieve the full table name (including the clouds' base name)
a String containing the full table name since: MMBase-1.7 |
getMMBase | public MMBase getMMBase()(Code) | | Return the MMBase object
since: 1.7 |
getNode | public MMObjectNode getNode(int number, boolean useCache)(Code) | | Retrieves a node based on it's number (a unique key).
Parameters: number - The number of the node to search for Parameters: useCache - If true, the node is retrieved from the node cache if possible. null if the node does not exist, the key is invalid,or aMMObjectNode containing the contents of the requested node. |
getNodeType | public int getNodeType(int number)(Code) | | Retrieves an object's type. If necessary, the type is added to the cache.
Parameters: number - The number of the node to search for an int value which is the object type (otype) of the node. |
getNodes | protected List<MMObjectNode> getNodes(Collection<MMObjectNode> virtuals)(Code) | | Convert virtual nodes to real nodes based on their otype
Normally a multirelations-search will return virtual nodes. These nodes
will only contain values which where specified in the field-vector.
This method will make real nodes of those virtual nodes.
Parameters: virtuals - containing virtual nodes List containing real nodes, directly from this Builders since: MMBase-1.6.2 |
getNodes | public List<MMObjectNode> getNodes(NodeSearchQuery query) throws SearchQueryException(Code) | | Returns nodes matching a specified constraint.
The constraint is specified by a query that selects nodes of
a specified type, which must be the nodetype corresponding
to this builder.
Parameters: query - The query. The nodes. throws: IllegalArgumentException - When the nodetype specifiedby the query is not the nodetype corresponding to this builder. since: MMBase-1.7 |
getTableName | public String getTableName()(Code) | | Retrieve the table name (without the clouds' base name)
a String containing the table name since: MMBase-1.7 |
searchVector | public Vector<MMObjectNode> searchVector(String where)(Code) | | Returns a vector containing all the objects that match the searchkeys
Parameters: where - scan expression that the objects need to fulfill a vector containing all the objects that apply.MMTable.getNodes(NodeSearchQuery)getNodes(NodeSearchQuery |
setMMBase | public void setMMBase(MMBase m)(Code) | | Set the MMBase object, and retrieve the storage layer.
Parameters: m - the MMBase object to set as owner of this builder |
setTableName | public void setTableName(String tableName)(Code) | | Set tablename of the builder. Should be used to initialize a MMTable object before calling init().
Parameters: tableName - the name of the table |
size | public int size()(Code) | | Determine the number of objects in this table.
The number of entries in the table. |
|
|