Package org.openbravo.service.json
Interface AdvancedQueryBuilderHook
-
- All Superinterfaces:
Prioritizable
- All Known Implementing Classes:
RelevantCharacteristicQueryHook
public interface AdvancedQueryBuilderHook extends Prioritizable
Allows to modify the queries built by theAdvancedQueryBuilder
by adding custom logic on some key points of the query building.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description List<JoinDefinition>
getJoinDefinitions(AdvancedQueryBuilder queryBuilder, List<JoinDefinition> joinDefinitins)
This method can be used to modify the join clauses of the query.String
parseOrderByClausePart(AdvancedQueryBuilder queryBuilder, String orderByPart)
This method is used to provide an alternative way of parsing a part of the order by clause.String
parseSimpleFilterClause(AdvancedQueryBuilder queryBuilder, String fieldName, String operator, Object value)
This method is used to provide an alternative way of parsing a simple filter clause.-
Methods inherited from interface org.openbravo.base.Prioritizable
getPriority
-
-
-
-
Method Detail
-
getJoinDefinitions
List<JoinDefinition> getJoinDefinitions(AdvancedQueryBuilder queryBuilder, List<JoinDefinition> joinDefinitins)
This method can be used to modify the join clauses of the query.- Parameters:
queryBuilder
- TheAdvancedQueryBuilder
instance. It can be used to access to information related to the query being builtjoinDefinitins
- The current list ofJoinDefinition
for the query being built- Returns:
- the new list of
JoinDefinition
of the query
-
parseSimpleFilterClause
String parseSimpleFilterClause(AdvancedQueryBuilder queryBuilder, String fieldName, String operator, Object value)
This method is used to provide an alternative way of parsing a simple filter clause. Note that this method may return null which means that the filter clause may be parsed by anotherAdvancedQueryBuilderHook
with less priority, if exists. In case there is no hook returning a not null value, then the filter clause will be parsed with the standard logic of theAdvancedQueryBuilder
.- Parameters:
queryBuilder
- TheAdvancedQueryBuilder
instance. It can be used to access to information related to the query being builtfieldName
- The name (it can be a path) of the property being filteredoperator
- The filtering operatorvalue
- The value to filter the property- Returns:
- a String containing the parsed filter clause or null in case this hook is not able to parse the filter clause
-
parseOrderByClausePart
String parseOrderByClausePart(AdvancedQueryBuilder queryBuilder, String orderByPart)
This method is used to provide an alternative way of parsing a part of the order by clause. Note that this method may return null which means that the part of the order by may be parsed by anotherAdvancedQueryBuilderHook
with less priority, if exists. In case there is no hook returning a not null value, then the order by clause will be parsed with the standard logic of theAdvancedQueryBuilder
.- Parameters:
queryBuilder
- TheAdvancedQueryBuilder
instance. It can be used to access to information related to the query being builtorderByPart
- One of the parts of order by clause of the query being built- Returns:
- a String with the parsed filter clause or null in case this hook is not able to parse the filter clause
-
-