|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.mmbase.bridge.implementation.BasicQuery
'Basic' implementation of bridge Query. Wraps a 'BasicSearchQuery' from core.
BasicSearchQuery| Field Summary | |
protected boolean |
aggregating
|
protected Cloud |
cloud
reference to the cloud. |
protected java.util.List |
explicitFields
The explicitely added 'extra' fields. |
protected java.util.List |
implicitFields
The implicitely added 'extra' fields. |
protected Constraint |
insecureConstraint
If a the contraint was made 'secure', in insecureConstraint the original Constraint is stored. |
protected BasicSearchQuery |
query
The core query which is 'wrapped' |
protected Authorization.QueryCheck |
queryCheck
The QueryCheck object associated with this Query, or null if no such object was determined yet. |
protected boolean |
used
Wether this Query was used already. |
| Fields inherited from interface org.mmbase.storage.search.SearchQuery |
DEFAULT_MAX_NUMBER, DEFAULT_OFFSET |
| Constructor Summary | |
BasicQuery(Cloud c,
BasicSearchQuery 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(java.lang.String fieldIdentifier)
Adds a field by string |
protected void |
addFieldImplicit(Step step,
Field field)
Fields which are added 'implicity' should be added by this function. |
void |
addNode(Step s,
int nodeNumber)
|
void |
addNode(Step s,
Node node)
Adds a node to a step. |
protected BasicRelationStep |
addRelationStep(InsRel insrel,
NodeManager otherNodeManager,
int direction)
|
RelationStep |
addRelationStep(NodeManager otherNodeManager)
|
RelationStep |
addRelationStep(NodeManager otherNodeManager,
java.lang.String role,
java.lang.String direction)
Adds new Relation step to the query. |
protected RelationStep |
addRelationStep(NodeManager otherNodeManager,
java.lang.String role,
java.lang.String direction,
boolean warnOnImpossibleStep)
|
SortOrder |
addSortOrder(StepField f,
int direction)
Adds an order on a certain field. |
Step |
addStep(NodeManager nm)
Adds a NodeManager to this Query. |
Query |
aggregatingClone()
Creates an unused aggregate clone of this query. |
java.lang.Object |
clone()
Create an (unused) clone |
Query |
cloneWithoutFields()
Clones this object, only without the fields |
protected java.lang.String |
createAlias(java.lang.String name)
Creates a unique alias for this Query based on a given base String |
CompositeConstraint |
createConstraint(Constraint c1,
int operator,
Constraint c2)
Combines two Constraints to one new one, using a boolean operator (AND or OR). |
FieldNullConstraint |
createConstraint(StepField f)
Create a contraint (for use with this Query object). |
FieldValueConstraint |
createConstraint(StepField f,
int op,
java.lang.Object v)
Create a contraint (for use with this Query object). |
CompareFieldsConstraint |
createConstraint(StepField f,
int op,
StepField v)
Create a contraint (for use with this Query object). |
FieldValueConstraint |
createConstraint(StepField f,
java.lang.Object v)
Create a contraint (for use with this Query object). |
FieldValueBetweenConstraint |
createConstraint(StepField f,
java.lang.Object o1,
java.lang.Object o2)
Create a contraint (for use with this Query object). |
FieldValueInConstraint |
createConstraint(StepField f,
java.util.SortedSet v)
Create a contraint (for use with this Query object). |
LegacyConstraint |
createConstraint(java.lang.String s)
Create a contraint (for use with this Query object). |
protected void |
createNewQuery()
|
StepField |
createStepField(Step step,
Field field)
Creates a StepField object withouth adding it (needed for aggregated queries). |
StepField |
createStepField(Step step,
java.lang.String fieldName)
|
StepField |
createStepField(java.lang.String fieldIdentifier)
Creates the step field for the given name. |
boolean |
equals(java.lang.Object obj)
Compares this query to the specified 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. |
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. |
Step |
getStep(java.lang.String stepAlias)
Returns the step with given alias, or null if it is not present |
java.util.List |
getSteps()
Gets the steps in the search request. |
protected java.lang.String |
glueAlias(java.lang.String aliasBase,
java.lang.Integer seq)
Glues a string and integer together to a new string. |
int |
hashCode()
|
boolean |
isAggregating()
Wheter this query is 'aggregating'. |
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. |
protected void |
removeSecurityConstraintFromClone(BasicSearchQuery clone)
|
void |
setAlias(Step step,
java.lang.String alias)
Sets the alias to the given step. |
FieldConstraint |
setCaseSensitive(FieldConstraint c,
boolean s)
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. |
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 boolean used
protected boolean aggregating
protected Authorization.QueryCheck queryCheck
protected Constraint insecureConstraint
protected BasicSearchQuery query
protected Cloud cloud
protected java.util.List implicitFields
protected java.util.List explicitFields
| Constructor Detail |
public BasicQuery(Cloud c,
BasicSearchQuery q)
| Method Detail |
protected void createNewQuery()
public 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 Constraint getCleanConstraint()
Query
getCleanConstraint in interface Querypublic 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 java.util.List getSortOrders()
SearchQueryThis corresponds to the ORDER BY clause in SQL SELECT syntax.
getSortOrders in interface SearchQuerypublic boolean isDistinct()
SearchQueryThis corresponds to the use of "DISTINCT" in SQL SELECT-syntax .
isDistinct in interface SearchQuerypublic boolean isAggregating()
Query
isAggregating in interface Queryprotected void removeSecurityConstraintFromClone(BasicSearchQuery clone)
public java.lang.Object clone()
Query
clone in interface Querypublic Query aggregatingClone()
Query
aggregatingClone in interface Querypublic Query cloneWithoutFields()
Query
cloneWithoutFields in interface Queryprotected java.lang.String createAlias(java.lang.String name)
protected java.lang.String glueAlias(java.lang.String aliasBase,
java.lang.Integer seq)
public Step addStep(NodeManager nm)
Query
addStep in interface Querynm - The nodeManager associated with the step.
Query.addRelationStep(org.mmbase.bridge.NodeManager, java.lang.String, java.lang.String)
public void setAlias(Step step,
java.lang.String alias)
Query
setAlias in interface Queryalias - The alias which must be given to the step. If it is "" an alias should be
generated. 'null' removes the alias.
protected BasicRelationStep addRelationStep(InsRel insrel,
NodeManager otherNodeManager,
int direction)
public RelationStep addRelationStep(NodeManager otherNodeManager)
addRelationStep in interface Query
public RelationStep addRelationStep(NodeManager otherNodeManager,
java.lang.String role,
java.lang.String direction)
Query getNext() on
the relationstep, and cast to Step.
addRelationStep in interface Query
protected RelationStep addRelationStep(NodeManager otherNodeManager,
java.lang.String role,
java.lang.String direction,
boolean warnOnImpossibleStep)
public void removeFields()
Query
removeFields in interface Query
public StepField addField(Step step,
Field field)
Query
addField in interface Querypublic StepField addField(java.lang.String fieldIdentifier)
Query
addField in interface Query
protected void addFieldImplicit(Step step,
Field field)
public StepField createStepField(Step step,
Field field)
Query
createStepField in interface Query
public StepField createStepField(Step step,
java.lang.String fieldName)
createStepField in interface Querypublic Step getStep(java.lang.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 StepField createStepField(java.lang.String fieldIdentifier)
Query
createStepField in interface Query
public AggregatedField addAggregatedField(Step step,
Field field,
int aggregationType)
Query
addAggregatedField in interface Querypublic Query setDistinct(boolean distinct)
Query
setDistinct in interface QueryBasicSearchQuery.setDistinct(boolean),
SearchQuery.isDistinct()public Query setMaxNumber(int maxNumber)
Query
setMaxNumber in interface QueryBasicSearchQuery.setMaxNumber(int),
SearchQuery.getMaxNumber()public Query setOffset(int offset)
Query
setOffset in interface QueryBasicSearchQuery.setOffset(int),
SearchQuery.getOffset()public LegacyConstraint createConstraint(java.lang.String s)
Query
createConstraint in interface QueryCloud.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 Query
public FieldValueConstraint createConstraint(StepField f,
java.lang.Object v)
Query
createConstraint in interface Query
public FieldValueConstraint createConstraint(StepField f,
int op,
java.lang.Object v)
Query
createConstraint in interface Query
public CompareFieldsConstraint createConstraint(StepField f,
int op,
StepField v)
Query
createConstraint in interface Query
public FieldValueBetweenConstraint createConstraint(StepField f,
java.lang.Object o1,
java.lang.Object o2)
Query
createConstraint in interface Query
public FieldValueInConstraint createConstraint(StepField f,
java.util.SortedSet v)
Query
createConstraint in interface Query
public Constraint setInverse(Constraint c,
boolean i)
Query
setInverse in interface Query
public FieldConstraint setCaseSensitive(FieldConstraint c,
boolean s)
Query
setCaseSensitive in interface Query
public CompositeConstraint createConstraint(Constraint c1,
int operator,
Constraint c2)
Query
createConstraint in interface Querypublic void setConstraint(Constraint c)
Query
setConstraint in interface Query
public SortOrder addSortOrder(StepField f,
int direction)
Query
addSortOrder in interface QueryBasicSearchQuery.addSortOrder(org.mmbase.storage.search.StepField),
SearchQuery.getSortOrders()
public void addNode(Step s,
int nodeNumber)
public void addNode(Step s,
Node node)
Query
addNode in interface Querypublic boolean isUsed()
Query
isUsed in interface Querypublic boolean markUsed()
Query
markUsed in interface Querypublic Cloud getCloud()
Query
getCloud in interface Querypublic 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 | ||||||||