Class SimpleExpression
- java.lang.Object
-
- io.ebeaninternal.server.expression.AbstractExpression
-
- io.ebeaninternal.server.expression.AbstractValueExpression
-
- io.ebeaninternal.server.expression.SimpleExpression
-
- All Implemented Interfaces:
Expression
,SpiExpression
public class SimpleExpression extends AbstractValueExpression
-
-
Field Summary
-
Fields inherited from interface io.ebeaninternal.api.SpiExpression
SQL_FALSE, SQL_TRUE
-
-
Constructor Summary
Constructors Constructor Description SimpleExpression(String propertyName, Op type, Object value)
-
Method Summary
All Methods Instance Methods Concrete 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.Object
getIdEqualTo(String idName)
Return the bind Id value if this is a "equal to" expression for the id property.String
getPropName()
Object
getValue()
boolean
isOpEquals()
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.int
queryBindHash()
Return the hash value for the values that will be bound.void
queryPlanHash(StringBuilder builder)
Based on the type and propertyName.void
writeDocQuery(DocQueryContext context)
Write the expression as an elastic search expression.-
Methods inherited from class io.ebeaninternal.server.expression.AbstractExpression
containsMany, copyForPlanKey, nestedPath, prepareExpression, simplify, validate
-
-
-
-
Constructor Detail
-
SimpleExpression
public SimpleExpression(String propertyName, Op type, Object value)
-
-
Method Detail
-
getIdEqualTo
public Object getIdEqualTo(String idName)
Description copied from interface:SpiExpression
Return the bind Id value if this is a "equal to" expression for the id property.- Specified by:
getIdEqualTo
in interfaceSpiExpression
- Overrides:
getIdEqualTo
in classAbstractExpression
-
naturalKey
public boolean naturalKey(NaturalKeyQueryData<?> data)
Description copied from interface:SpiExpression
Check for match to a natural key query returning false if it doesn't match.- Specified by:
naturalKey
in interfaceSpiExpression
- Overrides:
naturalKey
in classAbstractExpression
-
writeDocQuery
public void writeDocQuery(DocQueryContext context) throws IOException
Description copied from interface:SpiExpression
Write the expression as an elastic search expression.- Throws:
IOException
-
getPropName
public final String getPropName()
-
isOpEquals
public boolean isOpEquals()
-
addBindValues
public void addBindValues(SpiExpressionRequest request)
Description copied from interface:SpiExpression
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.
-
addSql
public void addSql(SpiExpressionRequest request)
Description copied from interface:SpiExpression
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.
-
queryPlanHash
public void queryPlanHash(StringBuilder builder)
Based on the type and propertyName.
-
queryBindHash
public int queryBindHash()
Description copied from interface:SpiExpression
Return the hash value for the values that will be bound.
-
isSameByBind
public boolean isSameByBind(SpiExpression other)
Description copied from interface:SpiExpression
Return true if the expression is the same with respect to bind values.
-
-