Package io.ebeaninternal.api
Interface SpiExpression
-
- All Superinterfaces:
Expression
- All Known Subinterfaces:
SpiExpressionList<T>
- All Known Implementing Classes:
AbstractExpression
,AbstractTextExpression
,AbstractValueExpression
,ArrayContainsExpression
,ArrayIsEmptyExpression
,DefaultExampleExpression
,DefaultExpressionList
,FilterExpressionList
,IdInExpression
,SimpleExpression
,TextMatchExpression
,TextMultiMatchExpression
public interface SpiExpression extends Expression
An expression that becomes part of a Where clause or Having clause.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description void
addBindValues(SpiExpressionRequest request)
Add the parameter values to be set against query.void
addSql(SpiExpressionRequest request)
Add some sql to the query.void
containsMany(BeanDescriptor<?> desc, ManyWhereJoins whereManyJoins)
Process "Many" properties populating ManyWhereJoins.SpiExpression
copyForPlanKey()
Return a copy of the expression for use in the query plan key.Object
getIdEqualTo(String idName)
Return the bind Id value if this is a "equal to" expression for the id property.boolean
isSameByBind(SpiExpression other)
Return true if the expression is the same with respect to bind values.boolean
naturalKey(NaturalKeyQueryData<?> data)
Check for match to a natural key query returning false if it doesn't match.String
nestedPath(BeanDescriptor<?> desc)
Return the nested path for this expression.void
prepareExpression(BeanQueryRequest<?> request)
Prepare the expression.int
queryBindHash()
Return the hash value for the values that will be bound.void
queryPlanHash(StringBuilder builder)
Calculate a hash value used to identify a query for AutoTune tuning.void
simplify()
Simplify nested expressions if possible.void
validate(SpiExpressionValidation validation)
Validate all the properties/paths associated with this expression.void
writeDocQuery(DocQueryContext context)
Write the expression as an elastic search expression.
-
-
-
Field Detail
-
SQL_TRUE
static final String SQL_TRUE
- See Also:
- Constant Field Values
-
SQL_FALSE
static final String SQL_FALSE
- See Also:
- Constant Field Values
-
-
Method Detail
-
simplify
void simplify()
Simplify nested expressions if possible.
-
writeDocQuery
void writeDocQuery(DocQueryContext context) throws IOException
Write the expression as an elastic search expression.- Throws:
IOException
-
nestedPath
String nestedPath(BeanDescriptor<?> desc)
Return the nested path for this expression.
-
containsMany
void containsMany(BeanDescriptor<?> desc, ManyWhereJoins whereManyJoins)
Process "Many" properties populating ManyWhereJoins.Predicates on Many properties require an extra independent join clause.
-
prepareExpression
void prepareExpression(BeanQueryRequest<?> request)
Prepare the expression. For example, compile sub-query expressions etc.
-
queryPlanHash
void queryPlanHash(StringBuilder builder)
Calculate a hash value used to identify a query for AutoTune tuning.That is, if the hash changes then the query will be considered different from an AutoTune perspective and get different tuning.
-
queryBindHash
int queryBindHash()
Return the hash value for the values that will be bound.
-
isSameByBind
boolean isSameByBind(SpiExpression other)
Return true if the expression is the same with respect to bind values.
-
addSql
void addSql(SpiExpressionRequest request)
Add some sql to the query.This will contain ? as a place holder for each associated bind values.
The 'sql' added to the query can contain object property names rather than db tables and columns. This 'sql' is later parsed converting the logical property names to their full database column names.
- Parameters:
request
- the associated request.
-
addBindValues
void addBindValues(SpiExpressionRequest request)
Add the parameter values to be set against query. For each ? place holder there should be a corresponding value that is added to the bindList.- Parameters:
request
- the associated request.
-
validate
void validate(SpiExpressionValidation validation)
Validate all the properties/paths associated with this expression.
-
copyForPlanKey
SpiExpression copyForPlanKey()
Return a copy of the expression for use in the query plan key.
-
getIdEqualTo
Object getIdEqualTo(String idName)
Return the bind Id value if this is a "equal to" expression for the id property.
-
naturalKey
boolean naturalKey(NaturalKeyQueryData<?> data)
Check for match to a natural key query returning false if it doesn't match.
-
-