|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.bridge.util.AbstractQueryWrapper<Q>
public abstract class AbstractQueryWrapper<Q extends Query>
Abstract base class for both QueryWrapper and NodeQueryWrapper.
| Field Summary | |
|---|---|
protected Q |
query
|
| Fields inherited from interface org.mmbase.storage.search.SearchQuery |
|---|
DEFAULT_MAX_NUMBER, DEFAULT_OFFSET |
| Constructor Summary | |
|---|---|
protected |
AbstractQueryWrapper(Q q)
|
| Method Summary | |
|---|---|
AggregatedField |
addAggregatedField(Step step,
Field field,
int aggregationType)
Add an aggregated field to a step |
StepField |
addField(Step step,
Field field)
Adds a field to a step. |
StepField |
addField(String field)
Adds a field by string |
void |
addNode(Step s,
int number)
|
void |
addNode(Step s,
Node node)
Adds a node to a step. |
RelationStep |
addRelationStep(NodeManager otherManager)
If you need to add a 'related' NodeManager without specifying a role/searchDir simply use these addRelationStep. |
RelationStep |
addRelationStep(NodeManager nodeManager,
String role,
String searchDir)
Adds new Relation step to the query. |
SortOrder |
addSortOrder(StepField f,
int direction)
Defaulting version of Query.addSortOrder(StepField, int, boolean, int) (sorting case
insensitively, and no date parts). |
SortOrder |
addSortOrder(StepField f,
int direction,
boolean caseSensitive)
Defaulting version of Query.addSortOrder(StepField, int, boolean, int) (no date parts) |
SortOrder |
addSortOrder(StepField f,
int direction,
boolean caseSensitive,
int part)
Adds an order on a certain field. |
Step |
addStep(NodeManager nodeManager)
Adds a NodeManager to this Query. |
Query |
aggregatingClone()
Creates an unused aggregate clone of this query. |
Query |
clone()
Create an (unused) clone |
void |
cloneQuery()
|
Query |
cloneWithoutFields()
Clones this object, only without the fields |
CompositeConstraint |
createConstraint(Constraint c1,
int op,
Constraint c2)
Combines two Constraints to one new one, using a boolean operator (AND or OR). |
FieldNullConstraint |
createConstraint(StepField f)
Create a constraint (for use with this Query object). |
FieldValueConstraint |
createConstraint(StepField f,
int op,
Object v)
Create a constraint (for use with this Query object). |
FieldValueConstraint |
createConstraint(StepField f,
int op,
Object v,
int part)
Create a constraint (for use with this Query object). |
CompareFieldsConstraint |
createConstraint(StepField f,
int op,
StepField v)
Create a constraint (for use with this Query object). |
FieldValueConstraint |
createConstraint(StepField f,
Object v)
Create a constraint (for use with this Query object). |
FieldValueBetweenConstraint |
createConstraint(StepField f,
Object o1,
Object o2)
Create a constraint (for use with this Query object). |
FieldValueInQueryConstraint |
createConstraint(StepField f,
Query q)
|
FieldValueInConstraint |
createConstraint(StepField f,
SortedSet<? extends Object> v)
Create a constraint (for use with this Query object). |
LegacyConstraint |
createConstraint(String s)
Create a constraint (for use with this Query object). |
StepField |
createStepField(Step step,
Field field)
Creates a StepField object withouth adding it (needed for aggregated queries). |
StepField |
createStepField(Step step,
String fieldName)
Creates a StepField object withouth adding it (needed for aggregated queries). |
StepField |
createStepField(String fieldIdentifier)
Creates the step field for the given name. |
boolean |
equals(Object obj)
Compares this query to the specified object. |
CachePolicy |
getCachePolicy()
Returns the CachePolicy of the object. |
Constraint |
getCleanConstraint()
Gets the 'clean' constraint on this query. |
Cloud |
getCloud()
Returns the Cloud for which this Query was defined. |
Constraint |
getConstraint()
Gets the constraints on the search results. |
List<StepField> |
getFields()
Gets the stepfields in the search request. |
NodeList |
getList()
Executes the query and returns the resulting node list. |
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. |
Q |
getQuery()
|
List<SortOrder> |
getSortOrders()
Gets the SortOrder objects in the order they are to be applied. |
String |
getSql()
|
Step |
getStep(String stepAlias)
Returns the step with given alias, or null if it is not present |
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. |
boolean |
isUsed()
Whether this query was used or not. |
boolean |
markUsed()
Mark this query 'used'. |
void |
removeFields()
Removes all fields from the Query object. |
void |
removeImplicitFields()
|
void |
setAlias(Step step,
String alias)
Sets the alias to the given step. |
void |
setCachePolicy(CachePolicy policy)
Sets the CachePolicy of the query. |
FieldConstraint |
setCaseSensitive(FieldConstraint constraint,
boolean sensitive)
Changes the given constraint's 'case sensitivity' (if applicable). |
void |
setConstraint(Constraint c)
The (composite) constraint can actually be set into the query with this method. |
Query |
setDistinct(boolean distinct)
Specifies wether the query result must contain only 'distinct' results. |
Constraint |
setInverse(Constraint c,
boolean i)
Changes the given constraint's 'inverse' (if applicable). |
Query |
setMaxNumber(int maxNumber)
Limits the query-result to maxNumber records. |
Query |
setOffset(int offset)
Offsets the query-result with offset records. |
String |
toSql()
Shows the query in a human-readable SQL form. |
String |
toString()
Returns a string representation of this SearchQuery. |
SearchQuery |
unwrap()
|
| Methods inherited from class java.lang.Object |
|---|
finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected Q extends Query query
| Constructor Detail |
|---|
protected AbstractQueryWrapper(Q q)
| Method Detail |
|---|
public void cloneQuery()
public String getSql()
public Q getQuery()
public SearchQuery unwrap()
unwrap in interface SearchQueryWrapperpublic Cloud getCloud()
Query
getCloud in interface Querypublic Step addStep(NodeManager nodeManager)
Query
addStep in interface QuerynodeManager - The nodeManager associated with the step.
Query.addRelationStep(NodeManager)
public void setAlias(Step step,
String alias)
Query
setAlias in interface Querystep - step to add the alias foralias - The alias which must be given to the step. If it is "" an alias should be
generated. 'null' removes the alias.public Step getStep(String stepAlias)
Query
getStep in interface QuerystepAlias - Alias for the step (may also be tableName, in which case the first step for this table is returned)
public RelationStep addRelationStep(NodeManager nodeManager,
String role,
String searchDir)
Query getNext() on
the relationstep, and cast to Step.
addRelationStep in interface QuerynodeManager - node manager on the other side of the relationrole - role of a relationsearchDir - the direction of the relation
public RelationStep addRelationStep(NodeManager otherManager)
Query
addRelationStep in interface QueryotherManager - node manager on the other side of the relation
public StepField addField(Step step,
Field field)
Query
addField in interface Querystep - step to add field tofield - field to add
public StepField addField(String field)
Query
addField in interface Queryfield - field to add
public void removeFields()
Query
removeFields in interface Query
public StepField createStepField(Step step,
Field field)
Query
createStepField in interface Querystep - step to create StepField fromfield - field to create StepField from
public StepField createStepField(Step step,
String fieldName)
Query
createStepField in interface Querystep - step to create StepField fromfieldName - name of field to create StepField from
public StepField createStepField(String fieldIdentifier)
Query
createStepField in interface QueryfieldIdentifier - field identifier to create StepField from
public AggregatedField addAggregatedField(Step step,
Field field,
int aggregationType)
Query
addAggregatedField in interface Querystep - step to add field tofield - field to addaggregationType - Type of aggregation
public Query setDistinct(boolean distinct)
Query
setDistinct in interface Querydistinct - 'distinct' results
BasicSearchQuery.setDistinct(boolean),
SearchQuery.isDistinct()public Query setMaxNumber(int maxNumber)
Query
setMaxNumber in interface QuerymaxNumber - max number of results
BasicSearchQuery.setMaxNumber(int)public Query setOffset(int offset)
Query
setOffset in interface Queryoffset - offset in results
BasicSearchQuery.setOffset(int)public Constraint getCleanConstraint()
Query
getCleanConstraint in interface Querypublic LegacyConstraint createConstraint(String s)
Query
createConstraint in interface Querys - String with LegacyConstraint
Cloud.getList(String startNodes, String nodePath, String fields, String constraints, String orderby, String directions, String searchDir, boolean distinct),
NodeManager.getList(String constraints, String orderby, String directions)public FieldNullConstraint createConstraint(StepField f)
Query
createConstraint in interface Queryf - Stepfield
public FieldValueConstraint createConstraint(StepField f,
Object v)
Query
createConstraint in interface Queryf - fieldv - value
public FieldValueConstraint createConstraint(StepField f,
int op,
Object v)
Query
createConstraint in interface Queryf - fieldop - operatorv - value
public FieldValueConstraint createConstraint(StepField f,
int op,
Object v,
int part)
Query
createConstraint in interface Queryf - fieldop - operatorv - valuepart - part of the date value
public CompareFieldsConstraint createConstraint(StepField f,
int op,
StepField v)
Query
createConstraint in interface Queryf - fieldop - operatorv - value
public FieldValueBetweenConstraint createConstraint(StepField f,
Object o1,
Object o2)
Query
createConstraint in interface Queryf - fieldo1 - value oneo2 - value two
public FieldValueInConstraint createConstraint(StepField f,
SortedSet<? extends Object> v)
Query
createConstraint in interface Queryf - fieldv - value
public FieldValueInQueryConstraint createConstraint(StepField f,
Query q)
createConstraint in interface Query
public FieldConstraint setCaseSensitive(FieldConstraint constraint,
boolean sensitive)
Query
setCaseSensitive in interface Queryconstraint - constraint to changesensitive - case sensitivity
public Constraint setInverse(Constraint c,
boolean i)
Query
setInverse in interface Queryc - constrainti - inverse
public CompositeConstraint createConstraint(Constraint c1,
int op,
Constraint c2)
Query
createConstraint in interface Queryc1 - constraint oneop - operator (CompositeConstraint.LOGICAL_AND, CompositeConstraint.LOGICAL_OR)c2 - constraint two
public void setConstraint(Constraint c)
Query
setConstraint in interface Queryc - constraint
public SortOrder addSortOrder(StepField f,
int direction,
boolean caseSensitive,
int part)
Query
addSortOrder in interface Queryf - fielddirection - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDINGcaseSensitive - case sensitivitypart - part to sort on for a date value
BasicSearchQuery.addSortOrder(org.mmbase.storage.search.StepField)
public SortOrder addSortOrder(StepField f,
int direction,
boolean caseSensitive)
QueryQuery.addSortOrder(StepField, int, boolean, int) (no date parts)
addSortOrder in interface Queryf - fielddirection - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDINGcaseSensitive - case sensitivity
public SortOrder addSortOrder(StepField f,
int direction)
QueryQuery.addSortOrder(StepField, int, boolean, int) (sorting case
insensitively, and no date parts).
addSortOrder in interface Queryf - fielddirection - SortOrder.ORDER_ASCENDING or SortOrder.ORDER_DESCENDING
public void addNode(Step s,
Node node)
Query
addNode in interface Querys - stepnode - node to add
public void addNode(Step s,
int number)
addNode in interface Querys - query stepnumber - node numberpublic boolean isUsed()
Query
isUsed in interface Querypublic boolean markUsed()
Query
markUsed in interface QuerymarkUsed in interface SearchQuerypublic Query clone()
Query
clone in interface Queryclone in interface PublicCloneable<Query>clone in class Objectpublic Query cloneWithoutFields()
Query
cloneWithoutFields in interface Querypublic Query aggregatingClone()
Query
aggregatingClone in interface Querypublic NodeList getList()
Query
getList in interface Querypublic String toSql()
Query
toSql in interface Querypublic void removeImplicitFields()
removeImplicitFields in interface Querypublic 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<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 List<SortOrder> getSortOrders()
SearchQueryThis corresponds to the ORDER BY clause in SQL SELECT syntax.
getSortOrders 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.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 CachePolicy getCachePolicy()
Cacheable
getCachePolicy in interface CacheableCachePolicy object.public void setCachePolicy(CachePolicy policy)
Cacheable
setCachePolicy in interface Cacheablepolicy - the CachePolicy object.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||