org.mmbase.storage.search.implementation
Class NodeSearchQuery

java.lang.Object
  extended byorg.mmbase.storage.search.implementation.BasicSearchQuery
      extended byorg.mmbase.storage.search.implementation.NodeSearchQuery
All Implemented Interfaces:
Cloneable, SearchQuery

public class NodeSearchQuery
extends BasicSearchQuery
implements SearchQuery

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,v 1.13 2006/02/09 12:04:19 johannes Exp $
Author:
Rob van Maris

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(MMObjectBuilder builder)
          Creator.
 
Method Summary
 BasicAggregatedField addAggregatedField(Step step, CoreField fieldDefs, int aggregationType)
          Adds new aggregated field to this SearchQuery.
 BasicStepField addField(Step step, CoreField fieldDefs)
          Adds new field to this SearchQuery.
 BasicRelationStep addRelationStep(InsRel builder, MMObjectBuilder nextBuilder)
          Adds new relationstep to this SearchQuery.
 BasicStep addStep(MMObjectBuilder builder)
          Adds new step to this SearchQuery.
protected  void copyFields(SearchQuery q)
           
protected  void copySteps(SearchQuery q)
           
 MMObjectBuilder getBuilder()
          Returns the builder for the specified nodetype.
 BasicStepField getField(CoreField field)
          Returns the stepfield corresponding to the specified field.
protected  void mapField(CoreField field, StepField stepField)
           
 
Methods inherited from class org.mmbase.storage.search.implementation.BasicSearchQuery
addFields, addSortOrder, clone, copyConstraint, copySortOrders, createNewStepField, equals, getConstraint, getFields, getMaxNumber, getOffset, getSortOrders, getSteps, hashCode, isAggregating, isDistinct, removeFields, setConstraint, setDistinct, setMaxNumber, 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, toString
 

Constructor Detail

NodeSearchQuery

public NodeSearchQuery(MMObjectBuilder builder)
Creator.

Parameters:
builder - The builder for the nodetype, must not be a virtual builder.
Throws:
IllegalArgumentException - When an invalid argument is supplied.
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(CoreField 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.

getBuilder

public MMObjectBuilder getBuilder()
Returns the builder for the specified nodetype.

Returns:
The builder.

addStep

public BasicStep addStep(MMObjectBuilder builder)
Description copied from class: BasicSearchQuery
Adds new step to this SearchQuery.

Overrides:
addStep in class BasicSearchQuery
Parameters:
builder - The builder associated with the step.
Returns:
The new step.

addRelationStep

public BasicRelationStep addRelationStep(InsRel builder,
                                         MMObjectBuilder nextBuilder)
Description copied from class: BasicSearchQuery
Adds new relationstep to this SearchQuery. This adds the next step as well, it can be retrieved by calling getNext() on the relationstep, and cast to BasicStep.

Overrides:
addRelationStep in class BasicSearchQuery
Parameters:
builder - The builder associated with the relation step.
nextBuilder - The builder associated with the next step.
Returns:
The new relationstep.

addField

public BasicStepField addField(Step step,
                               CoreField 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(CoreField field,
                        StepField stepField)
Overrides:
mapField in class BasicSearchQuery

addAggregatedField

public BasicAggregatedField addAggregatedField(Step step,
                                               CoreField 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 build 1.8.1.20060716