Package org.ametys.cms.search.query
Class ContentQuery
- java.lang.Object
 - 
- org.ametys.cms.search.query.AbstractFieldQuery
 - 
- org.ametys.cms.search.query.ContentQuery
 
 
 
- 
- All Implemented Interfaces:
 Query
public class ContentQuery extends AbstractFieldQuery
Represents aQuerytesting a content field. 
- 
- 
Nested Class Summary
- 
Nested classes/interfaces inherited from interface org.ametys.cms.search.query.Query
Query.LogicalOperator, Query.Operator 
 - 
 
- 
Field Summary
Fields Modifier and Type Field Description protected ContentHelper_contentHelperThe extension point.protected boolean_isAndMultipleOperandtrueif the query should be executed with an AndQuery.protected Query.Operator_operatorThe operatorprotected HierarchicalReferenceTablesHelper_refTableHelperThe helper to resolve the reference tables.protected boolean_resolveChildrentrueif the query should be executed by resolving the children.protected AmetysObjectResolver_resolverThe resolver to resolve the results.protected Object_valueThe value to test.- 
Fields inherited from class org.ametys.cms.search.query.AbstractFieldQuery
_fieldPath 
 - 
 
- 
Constructor Summary
Constructors Constructor Description ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper)Build a content query.ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, boolean isAndMultipleOperand)Build a content query by testing the operand.ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, HierarchicalReferenceTablesHelper refTableHelper, boolean resolveChildren)Build a content query by testing if the ancestors should be resolved.ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, HierarchicalReferenceTablesHelper refTableHelper, boolean resolveChildren, boolean isAndMultipleOperand)Build a content query by testing the operand and if the ancestors should be resolved. 
- 
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Stringbuild()Build the solr query string representing the Query object.booleanequals(Object obj)ObjectgetValue()Get the value.inthashCode()- 
Methods inherited from class org.ametys.cms.search.query.AbstractFieldQuery
getFieldPath 
 - 
 
 - 
 
- 
- 
Field Detail
- 
_operator
protected Query.Operator _operator
The operator 
- 
_resolver
protected AmetysObjectResolver _resolver
The resolver to resolve the results. 
- 
_contentHelper
protected ContentHelper _contentHelper
The extension point. 
- 
_isAndMultipleOperand
protected boolean _isAndMultipleOperand
trueif the query should be executed with an AndQuery. 
- 
_refTableHelper
protected HierarchicalReferenceTablesHelper _refTableHelper
The helper to resolve the reference tables. 
- 
_resolveChildren
protected boolean _resolveChildren
trueif the query should be executed by resolving the children. 
 - 
 
- 
Constructor Detail
- 
ContentQuery
public ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper)
Build a content query.- Parameters:
 fieldPath- the field's pathoperator- the operatorvalue- the valueresolver- the resolvercontentHelper- the content helper
 
- 
ContentQuery
public ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, boolean isAndMultipleOperand)
Build a content query by testing the operand.- Parameters:
 fieldPath- the field's pathoperator- the operatorvalue- the valueresolver- the resolvercontentHelper- the content helperisAndMultipleOperand- 'true' to execute an AndQuery, OrQuery otherwise
 
- 
ContentQuery
public ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, HierarchicalReferenceTablesHelper refTableHelper, boolean resolveChildren)
Build a content query by testing if the ancestors should be resolved.- Parameters:
 fieldPath- the field's pathoperator- the operatorvalue- the valueresolver- the resolvercontentHelper- the content helperrefTableHelper- The helper to resolve the ancestorsresolveChildren- 'true' to execute an OrQuery on the ancestors and itself, 'false' will execute a join request
 
- 
ContentQuery
public ContentQuery(String fieldPath, Query.Operator operator, Object value, AmetysObjectResolver resolver, ContentHelper contentHelper, HierarchicalReferenceTablesHelper refTableHelper, boolean resolveChildren, boolean isAndMultipleOperand)
Build a content query by testing the operand and if the ancestors should be resolved.- Parameters:
 fieldPath- the field's pathoperator- The operator. OnlyQuery.Operator.EQandQuery.Operator.NEare allowed.value- the valueresolver- the resolvercontentHelper- the content helperrefTableHelper- The helper to resolve the ancestorsresolveChildren- 'true' to execute an OrQuery on the ancestors and itself, 'false' will execute a join requestisAndMultipleOperand- 'true' to execute an AndQuery, OrQuery otherwise
 
 - 
 
- 
Method Detail
- 
build
public String build() throws QuerySyntaxException
Description copied from interface:QueryBuild the solr query string representing the Query object.- Returns:
 - the solr query string representing the Query object.
 - Throws:
 QuerySyntaxException- if the query can't be built because of a syntax error.
 
- 
hashCode
public int hashCode()
- Overrides:
 hashCodein classAbstractFieldQuery
 
- 
equals
public boolean equals(Object obj)
- Overrides:
 equalsin classAbstractFieldQuery
 
 - 
 
 -