|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.storage.search.implementation.BasicSearchQuery
Basic implementation.
| Field Summary | |
static int |
COPY_AGGREGATING
|
static int |
COPY_NORMAL
|
static int |
COPY_WITHOUTFIELDS
|
protected java.util.List |
fields
StepField list. |
| Fields inherited from interface org.mmbase.storage.search.SearchQuery |
DEFAULT_MAX_NUMBER, DEFAULT_OFFSET |
| Constructor Summary | |
BasicSearchQuery()
Constructor, constructs non-aggragating query. |
|
BasicSearchQuery(boolean aggregating)
Constructor. |
|
BasicSearchQuery(SearchQuery q)
A deep copy. |
|
BasicSearchQuery(SearchQuery q,
int copyMethod)
A deep copy, but sets also aggregating, and clear fields if aggregating is true then. |
|
| Method Summary | |
BasicAggregatedField |
addAggregatedField(Step step,
FieldDefs fielDefs,
int aggregationType)
Adds new aggregated field to this SearchQuery. |
BasicStepField |
addField(Step step,
FieldDefs fieldDefs)
Adds new field to this SearchQuery. |
void |
addFields(Step step)
|
BasicRelationStep |
addRelationStep(InsRel builder,
MMObjectBuilder nextBuilder)
Adds new relationstep to this SearchQuery. |
BasicSortOrder |
addSortOrder(StepField field)
Creates sortorder for this SearchQuery. |
BasicStep |
addStep(MMObjectBuilder builder)
Adds new step to this SearchQuery. |
java.lang.Object |
clone()
|
protected Constraint |
copyConstraint(SearchQuery q,
Constraint c)
Used by copy-constructor. |
protected void |
copyFields(SearchQuery q)
|
protected void |
copySortOrders(SearchQuery q)
|
protected void |
copySteps(SearchQuery q)
|
protected StepField |
createNewStepField(SearchQuery q,
StepField f)
Creates a new StepField like f for query q. |
boolean |
equals(java.lang.Object obj)
Compares this query to the specified object. |
Constraint |
getConstraint()
Gets the constraints on the search results. |
java.util.List |
getFields()
Gets the stepfields in the search request. |
int |
getMaxNumber()
Gets the maximum number of results to be returned, or -1 if the number of results to be returned is unlimited. |
int |
getOffset()
Gets the (zerobased) offset in the list of results, of the first result to return. |
java.util.List |
getSortOrders()
Gets the SortOrder objects in the order they are to be applied. |
java.util.List |
getSteps()
Gets the steps in the search request. |
int |
hashCode()
|
boolean |
isAggregating()
Tests if this is an aggregating query, i.e. |
boolean |
isDistinct()
Tests if the search request is to return distinct results. |
protected void |
mapField(FieldDefs field,
StepField stepField)
|
void |
removeFields()
|
void |
setConstraint(Constraint constraint)
Sets constraint. |
BasicSearchQuery |
setDistinct(boolean distinct)
Sets distinct. |
BasicSearchQuery |
setMaxNumber(int maxNumber)
Sets maxNumber. |
BasicSearchQuery |
setOffset(int offset)
Sets offset. |
java.lang.String |
toString()
Returns a string representation of this SearchQuery. |
| Methods inherited from class java.lang.Object |
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
protected java.util.List fields
public static final int COPY_NORMAL
public static final int COPY_AGGREGATING
public static final int COPY_WITHOUTFIELDS
| Constructor Detail |
public BasicSearchQuery(boolean aggregating)
aggregating - True for an aggregating query, false otherwise.public BasicSearchQuery()
public BasicSearchQuery(SearchQuery q,
int copyMethod)
public BasicSearchQuery(SearchQuery q)
Query.clone()| Method Detail |
public java.lang.Object clone()
protected void copySteps(SearchQuery q)
protected void copyFields(SearchQuery q)
protected void copySortOrders(SearchQuery q)
protected StepField createNewStepField(SearchQuery q,
StepField f)
protected Constraint copyConstraint(SearchQuery q,
Constraint c)
public BasicSearchQuery setDistinct(boolean distinct)
distinct - The distinct value.
BasicSearchQuery instance.public BasicSearchQuery setMaxNumber(int maxNumber)
maxNumber - The maxNumber value.
BasicSearchQuery instance.
java.lang.IllegalArgumentException - when an invalid argument is supplied.public BasicSearchQuery setOffset(int offset)
offset - The offset value.
BasicSearchQuery instance.
java.lang.IllegalArgumentException - when an invalid argument is supplied.public BasicStep addStep(MMObjectBuilder builder)
builder - The builder associated with the step.
java.lang.IllegalArgumentException - when an invalid argument is supplied.
public BasicRelationStep addRelationStep(InsRel builder,
MMObjectBuilder nextBuilder)
getNext()
on the relationstep, and cast to BasicStep.
builder - The builder associated with the relation step.nextBuilder - The builder associated with the next step.
java.lang.IllegalArgumentException - when an invalid argument is supplied.
java.lang.IllegalStateException - when there is no previous step.
public BasicStepField addField(Step step,
FieldDefs fieldDefs)
step - The associated step.fieldDefs - The associated fieldDefs.
java.lang.IllegalArgumentException - when an invalid argument is supplied.
java.lang.UnsupportedOperationException - when called
on an aggregating query.
protected void mapField(FieldDefs field,
StepField stepField)
public void addFields(Step step)
public void removeFields()
public BasicAggregatedField addAggregatedField(Step step,
FieldDefs fielDefs,
int aggregationType)
step - The associated step.
java.lang.IllegalArgumentException - when an invalid argument is supplied.
java.lang.UnsupportedOperationException - when called
on an non-aggregating query.public BasicSortOrder addSortOrder(StepField field)
field - The associated stepfield.
java.lang.IllegalArgumentException - when an invalid argument is supplied.public void setConstraint(Constraint constraint)
constraint - The constraint.
java.lang.IllegalArgumentException - when an invalid argument is supplied.public boolean isDistinct()
SearchQueryThis corresponds to the use of "DISTINCT" in SQL SELECT-syntax .
isDistinct in interface SearchQuerypublic boolean isAggregating()
SearchQuery
isAggregating in interface SearchQuerypublic java.util.List getSortOrders()
SearchQueryThis corresponds to the ORDER BY clause in SQL SELECT syntax.
getSortOrders in interface SearchQuerypublic java.util.List getSteps()
SearchQueryThis corresponds to the tables in SQL SELECT-syntax.
getSteps in interface SearchQuerypublic java.util.List getFields()
SearchQueryThis corresponds to the fields in SQL SELECT-syntax.
getFields in interface SearchQuerypublic Constraint getConstraint()
SearchQueryThis corresponds to (part of) the constraints in the WHERE-clause in SQL SELECT-syntax.
getConstraint in interface SearchQuerypublic int getMaxNumber()
SearchQueryNote: limiting the number of results may not be supported by the database layer.
getMaxNumber in interface SearchQuerypublic int getOffset()
SearchQueryNote: skipping results may not be supported by the database layer.
getOffset in interface SearchQuerypublic boolean equals(java.lang.Object obj)
SearchQuerytrue if and only if the argument is a non-null
SearchQuery object representing the same query.
equals in interface SearchQuerypublic int hashCode()
hashCode in interface SearchQuerypublic java.lang.String toString()
SearchQueryisDistinct()
getSteps()
getFields()
getConstraint()
getSortOrders()
getMaxNumber()
getOffset()
toString in interface SearchQuery
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||