|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.storage.search.implementation.BasicSearchQuery
public class BasicSearchQuery
Basic implementation.
| Field Summary | |
|---|---|
static int |
COPY_AGGREGATING
|
static int |
COPY_NORMAL
|
static int |
COPY_WITHOUTFIELDS
|
protected List<StepField> |
fields
|
| 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,
Field field,
int aggregationType)
Adds new aggregated field to this SearchQuery. |
BasicStepField |
addField(Step step,
Field fieldDefs)
Adds new field to this SearchQuery. |
void |
addFields(Step step,
QueryContext qc)
|
protected void |
addFields(Step step,
String builder,
QueryContext qc)
Add all fields of given step |
BasicStepField |
addFieldUnlessPresent(Step step,
Field fieldDefs)
|
BasicRelationStep |
addRelationStep(Object builder,
Object nextBuilder)
Deprecated. Use {@link #addRelationStep(String, String). |
BasicRelationStep |
addRelationStep(String builder,
String nextBuilder)
|
BasicSortOrder |
addSortOrder(StepField field)
Creates sortorder for this SearchQuery. |
BasicStep |
addStep(Object builder)
Deprecated. Use {@link #addStep(String). |
BasicStep |
addStep(String name)
|
protected int |
calculateHashCode()
|
BasicSearchQuery |
clone()
|
protected static 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 static StepField |
createNewStepField(SearchQuery q,
StepField f)
Creates a new StepField like f for query q. |
boolean |
equals(Object obj)
Compares this query to the specified object. |
int |
getByteSize()
Determines the byte-size of this object |
int |
getByteSize(SizeOf sizeof)
Determines the byte-size of this object using the given SizeOf instance. |
CachePolicy |
getCachePolicy()
Returns the CachePolicy of the object. |
Constraint |
getConstraint()
Gets the constraints on the search results. |
List<StepField> |
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. |
List<SortOrder> |
getSortOrders()
Gets the SortOrder objects in the order they are to be applied. |
List<Step> |
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(Field field,
BasicStepField stepField)
|
boolean |
markUsed()
|
void |
removeFields()
|
void |
setCachePolicy(CachePolicy policy)
Sets the CachePolicy of the query. |
void |
setConstraint(Constraint constraint)
Sets constraint. |
BasicSearchQuery |
setDistinct(boolean distinct)
Sets distinct. |
BasicSearchQuery |
setMaxNumber(int maxNumber)
Sets maxNumber. |
void |
setModifiable(boolean b)
|
BasicSearchQuery |
setOffset(int offset)
Sets offset. |
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 List<StepField> 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 BasicSearchQuery clone()
clone in interface PublicCloneable<BasicSearchQuery>clone in class Objectprotected void copySteps(SearchQuery q)
protected void copyFields(SearchQuery q)
protected void copySortOrders(SearchQuery q)
protected static StepField createNewStepField(SearchQuery q,
StepField f)
protected static 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.
IllegalArgumentException - when an invalid argument is supplied.public BasicSearchQuery setOffset(int offset)
offset - The offset value.
BasicSearchQuery instance.
IllegalArgumentException - when an invalid argument is supplied.public BasicStep addStep(Object builder)
builder - The builder associated with the step.
IllegalArgumentException - when an invalid argument is
supplied.public BasicStep addStep(String name)
public BasicRelationStep addRelationStep(Object builder,
Object 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.
IllegalArgumentException - when an invalid argument is supplied.
IllegalStateException - when there is no previous step.
public BasicRelationStep addRelationStep(String builder,
String nextBuilder)
public BasicStepField addField(Step step,
Field fieldDefs)
step - The associated step.fieldDefs - The associated fieldDefs.
IllegalArgumentException - when an invalid argument is supplied.
UnsupportedOperationException - when called
on an aggregating query.
public BasicStepField addFieldUnlessPresent(Step step,
Field fieldDefs)
protected void mapField(Field field,
BasicStepField stepField)
public void addFields(Step step,
QueryContext qc)
protected void addFields(Step step,
String builder,
QueryContext qc)
public void removeFields()
public BasicAggregatedField addAggregatedField(Step step,
Field field,
int aggregationType)
step - The associated step.field - The associated Field.aggregationType - The aggregation type.
IllegalArgumentException - when an invalid argument is supplied.
UnsupportedOperationException - when called
on an non-aggregating query.public BasicSortOrder addSortOrder(StepField field)
field - The associated stepfield.
IllegalArgumentException - when an invalid argument is supplied.public void setConstraint(Constraint constraint)
constraint - The constraint.
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 List<SortOrder> getSortOrders()
SearchQueryThis corresponds to the ORDER BY clause in SQL SELECT syntax.
getSortOrders in interface SearchQuerypublic List<Step> getSteps()
SearchQueryThis corresponds to the tables in SQL SELECT-syntax.
getSteps in interface SearchQuerypublic List<StepField> 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 CachePolicy getCachePolicy()
Cacheable
getCachePolicy in interface CacheableCachePolicy object.public void setCachePolicy(CachePolicy policy)
Cacheable
setCachePolicy in interface Cacheablepolicy - the CachePolicy object.public void setModifiable(boolean b)
public boolean markUsed()
markUsed in interface SearchQuerypublic boolean equals(Object obj)
SearchQuerytrue if and only if the argument is a non-null
SearchQuery object representing the same query.
equals in interface SearchQueryequals in class Objectobj - The object to compare with.
true if the objects are equal,
false otherwise.protected int calculateHashCode()
public int hashCode()
hashCode in interface SearchQueryhashCode in class Objectpublic String toString()
SearchQueryisDistinct()
getSteps()
getFields()
getConstraint()
getSortOrders()
getMaxNumber()
getOffset()
toString in interface SearchQuerytoString in class Objectpublic int getByteSize()
SizeMeasurable
getByteSize in interface SizeMeasurablepublic int getByteSize(SizeOf sizeof)
SizeMeasurable
getByteSize in interface SizeMeasurable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||