public class FlexibleSearchQuery extends AbstractQuery
The FlexibleSearchQuery stores all needed informations (the query itself, parameters, ...) to execute a search in the
FlexibleSearchService. This class provides possibility to write much more cleaner code than with manually
handling query and parameters.
...
final Map queryParams = new HashMap
Please note that this class is not thread-safe and not intended to be living longer than one request.
| Constructor and Description |
|---|
FlexibleSearchQuery(java.lang.String query)
FlexibleSearchQuery constructor.
|
FlexibleSearchQuery(java.lang.StringBuilder sb)
FlexibleSearchQuery constructor.
|
FlexibleSearchQuery(java.lang.String query,
java.util.Map queryParams)
FlexibleSearchQuery constructor.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addHints(Hint... hints)
Adds hints to Flexible Search query.
|
void |
addHints(java.util.List<? extends Hint> hints)
Adds hints to Flexible Search query.
|
void |
addQueryParameter(java.lang.String key,
java.lang.Object value)
Add a query parameter to the search.
|
void |
addQueryParameters(java.util.Map<java.lang.String,? extends java.lang.Object> params)
Add a additional parameter map (String->Object) to the search.
|
boolean |
equals(java.lang.Object obj) |
java.util.List<Hint> |
getHints() |
java.lang.String |
getQuery() |
java.util.Map<java.lang.String,java.lang.Object> |
getQueryParameters() |
int |
hashCode() |
java.lang.String |
toString() |
getCatalogVersions, getCount, getLanguage, getLocale, getResultClassList, getSessionSearchRestrictions, getStart, getUser, isDisableCaching, isDisableSearchRestrictions, isDisableSpecificDbLimitSupport, isFailOnUnknownFields, isNeedTotal, setCatalogVersions, setCatalogVersions, setCount, setDisableCaching, setDisableSearchRestrictions, setDisableSpecificDbLimitSupport, setFailOnUnknownFields, setLanguage, setLocale, setNeedTotal, setResultClassList, setSessionSearchRestrictions, setSessionSearchRestrictions, setStart, setUserpublic FlexibleSearchQuery(java.lang.String query)
addQueryParameter(String, Object) / addQueryParameters(Map) or instead use the
constructor FlexibleSearchQuery(String, Map).query - the flexible search querypublic FlexibleSearchQuery(java.lang.StringBuilder sb)
addQueryParameter(String, Object) / addQueryParameters(Map) or
instead use the constructor FlexibleSearchQuery(String, Map).sb - the StringBuilder object containing flexible search querypublic FlexibleSearchQuery(java.lang.String query,
java.util.Map queryParams)
query - the flexible search queryqueryParams - a Mappublic void addHints(Hint... hints)
hints - Hint} {@link de.hybris.platform.jalo.flexiblesearch.hints.QueryHint}
{@link de.hybris.platform.jalo.flexiblesearch.hints.PreparedStatementHint}public void addHints(java.util.List<? extends Hint> hints)
hints - Hint} {@link de.hybris.platform.jalo.flexiblesearch.hints.QueryHint}
{@link de.hybris.platform.jalo.flexiblesearch.hints.PreparedStatementHint}public java.util.List<Hint> getHints()
public void addQueryParameter(java.lang.String key,
java.lang.Object value)
Add a query parameter to the search. The key is referenced in the query (see getQuery()) with
?<key>
Note that:
null value is not legal parameters.
empty Collection value is not legal parameters.
key - the key of the parametervalue - the value of the parameterpublic void addQueryParameters(java.util.Map<java.lang.String,? extends java.lang.Object> params)
Add a additional parameter map (String->Object) to the search. Each key is referenced in the query (see
getQuery()) with ?<key>
Note that:
null value in params map is not legal.
empty Collection value in params map is not legal.
params - the mappublic boolean equals(java.lang.Object obj)
equals in class java.lang.Objectpublic java.lang.String getQuery()
public java.util.Map<java.lang.String,java.lang.Object> getQueryParameters()
public int hashCode()
hashCode in class java.lang.Objectpublic java.lang.String toString()
toString in class java.lang.ObjectCopyright © 2018 SAP SE. All Rights Reserved.