org.mmbase.storage.search.implementation
Class NodeSearchQuery

java.lang.Object
  extended by org.mmbase.storage.search.implementation.BasicSearchQuery
      extended by org.mmbase.storage.search.implementation.NodeSearchQuery
All Implemented Interfaces:
Serializable, Cloneable, Cacheable, SearchQuery, PublicCloneable<BasicSearchQuery>, SizeMeasurable
Direct Known Subclasses:
NodeSearchQuery

public class NodeSearchQuery
extends BasicSearchQuery
implements SearchQuery, Serializable

A NodeSearchQuery implements a SearchQuery that retrieves nodes of one specified nodetype.

The constructor creates the query with all persistent fields belonging to the specified nodetype excluding byte[] type fields. Use getField() to retrieve each of these fields.

Once an instance is constructed, it is not possible to add more fields/steps. Consequently calling one of these methods always results in an UnsupportedOperationException:

Since:
MMBase-1.7
Version:
$Id: NodeSearchQuery.java 42916 2010-07-15 16:54:59Z michiel $
Author:
Rob van Maris
See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.mmbase.storage.search.implementation.BasicSearchQuery
COPY_AGGREGATING, COPY_NORMAL, COPY_WITHOUTFIELDS, fields
 
Fields inherited from interface org.mmbase.storage.search.SearchQuery
DEFAULT_MAX_NUMBER, DEFAULT_OFFSET
 
Constructor Summary
NodeSearchQuery(NodeManager nodeManager)
           
NodeSearchQuery(String builder, QueryContext qc)
          Creator.
 
Method Summary
 BasicAggregatedField addAggregatedField(Step step, Field fieldDefs, int aggregationType)
          Adds new aggregated field to this SearchQuery.
 BasicStepField addField(Step step, Field fieldDefs)
          Adds new field to this SearchQuery.
 BasicRelationStep addRelationStep(String builder, String nextBuilder)
           
 BasicStep addStep(String builder)
           
protected  void copyFields(SearchQuery q)
           
protected  void copySteps(SearchQuery q)
           
 BasicStepField getField(Field field)
          Returns the stepfield corresponding to the specified field.
 String getTableName()
          Returns the builder for the specified nodetype.
protected  void mapField(Field field, BasicStepField stepField)
           
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicSearchQuery
addFields, addFields, addFieldUnlessPresent, addRelationStep, addSortOrder, addStep, calculateHashCode, clone, copyConstraint, copySortOrders, createNewStepField, equals, getByteSize, getByteSize, getCachePolicy, getConstraint, getFields, getMaxNumber, getOffset, getSortOrders, getSteps, hashCode, isAggregating, isDistinct, markUsed, removeFields, setCachePolicy, setConstraint, setDistinct, setMaxNumber, setModifiable, setOffset, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.mmbase.storage.search.SearchQuery
equals, getConstraint, getFields, getMaxNumber, getOffset, getSortOrders, getSteps, hashCode, isAggregating, isDistinct, markUsed, toString
 
Methods inherited from interface org.mmbase.cache.Cacheable
getCachePolicy, setCachePolicy
 

Constructor Detail

NodeSearchQuery

public NodeSearchQuery(String builder,
                       QueryContext qc)
Creator.

Parameters:
builder - The builder for the nodetype, must not be a virtual builder.
Throws:
IllegalArgumentException - When an invalid argument is supplied.

NodeSearchQuery

public NodeSearchQuery(NodeManager nodeManager)
Method Detail

copySteps

protected void copySteps(SearchQuery q)
Overrides:
copySteps in class BasicSearchQuery

copyFields

protected void copyFields(SearchQuery q)
Overrides:
copyFields in class BasicSearchQuery

getField

public BasicStepField getField(Field field)
Returns the stepfield corresponding to the specified field.

Parameters:
field - The field.
Returns:
The corresponding stepfield.
Throws:
IllegalArgumentException - When the field is not a persistent field of the associated nodetype.

getTableName

public String getTableName()
Returns the builder for the specified nodetype.

Returns:
The builder.

addStep

public BasicStep addStep(String builder)
Overrides:
addStep in class BasicSearchQuery

addRelationStep

public BasicRelationStep addRelationStep(String builder,
                                         String nextBuilder)
Overrides:
addRelationStep in class BasicSearchQuery

addField

public BasicStepField addField(Step step,
                               Field fieldDefs)
Description copied from class: BasicSearchQuery
Adds new field to this SearchQuery.

Overrides:
addField in class BasicSearchQuery
Parameters:
step - The associated step.
fieldDefs - The associated fieldDefs.
Returns:
The new field.

mapField

protected void mapField(Field field,
                        BasicStepField stepField)
Overrides:
mapField in class BasicSearchQuery

addAggregatedField

public BasicAggregatedField addAggregatedField(Step step,
                                               Field fieldDefs,
                                               int aggregationType)
Description copied from class: BasicSearchQuery
Adds new aggregated field to this SearchQuery.

Overrides:
addAggregatedField in class BasicSearchQuery
Parameters:
step - The associated step.
fieldDefs - The associated Field.
aggregationType - The aggregation type.
Returns:
The new field.


MMBase 2.0-SNAPSHOT - null