Package io.ebeaninternal.server.el
Class ElPropertyChain
- java.lang.Object
-
- io.ebeaninternal.server.el.ElPropertyChain
-
- All Implemented Interfaces:
ExpressionPath
,ElPropertyDeploy
,ElPropertyValue
public class ElPropertyChain extends Object implements ElPropertyValue
A ElGetValue based on a chain of properties.Used to get the value for an compound expression like customer.name or customer.shippingAddress.city etc.
Note that if any element in the chain returns null, then null is returned and no further processing of the chain occurs.
-
-
Field Summary
-
Fields inherited from interface io.ebeaninternal.server.el.ElPropertyDeploy
ROOT_ELPREFIX
-
-
Constructor Summary
Constructors Constructor Description ElPropertyChain(boolean containsMany, boolean embedded, String expression, ElPropertyValue[] chain)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
containsFormulaWithJoin()
Return true if the property is a formula with a join clause.boolean
containsMany()
Return true if there is a property on the path that is a many property.boolean
containsManySince(String sinceProperty)
Return true if there is a many property from sinceProperty to the end of this chain.Object
convert(Object value)
Convert the value to the expected type.String
getAssocIdExpression(String prefix, String operator)
Return the Id expression string.String
getAssocIdInExpr(String prefix)
Return the logical id in expression taking into account embedded id's.String
getAssocIdInValueExpr(boolean not, int size)
Return the logical id value expression taking into account embedded id's.Object[]
getAssocIdValues(EntityBean bean)
Return the Id values for the given bean value.String
getAssocIsEmpty(SpiExpressionRequest request, String path)
Return the logical where clause to support "Is empty".BeanProperty
getBeanProperty()
Return the underlying bean property.String
getDbColumn()
Return the deployment db column for this property.String
getElName()
The ElPrefix plus name.String
getElPlaceholder(boolean encrypted)
Return the place holder in the form of ${elPrefix}dbColumn.String
getElPrefix()
Return the prefix path of the property.int
getFetchPreference()
Return the fetch preference.int
getJdbcType()
Return the underlying JDBC type or 0 if this is not a scalar type.String
getName()
Return the name of the property.Property
getProperty()
Return the underlying bean property.StringParser
getStringParser()
Return the default StringParser for the scalar property.boolean
isAggregation()
Return true if this is an aggregation property.boolean
isAssocId()
Return true if this is an ManyToOne or OneToOne associated bean property.boolean
isAssocMany()
Return true if the property is a OneToMany or ManyToMany associated bean property.boolean
isAssocProperty()
Return true if any path of this path contains a Associated One or Many.boolean
isDateTimeCapable()
Return true if the last type is "DateTime capable" - can supportExpressionPath.parseDateTime(long)
.boolean
isDbEncrypted()
Return true if the property is encrypted in the DB.boolean
isLocalEncrypted()
Return true if the property is encrypted via Java.Object
localEncrypt(Object value)
Encrypt the input value return the encrypted value.Object
parseDateTime(long systemTimeMillis)
For DateTime capable scalar types convert the long systemTimeMillis into an appropriate java time (Date,Timestamp,Time,Calendar, JODA type etc).Object
pathGet(Object bean)
Return the value from a given entity bean.Object
pathGetNested(Object bean)
Return the value ensuring objects prior to the top scalar property are automatically populated.void
pathSet(Object bean, Object value)
Set a value to the bean for this expression path.String
toString()
-
-
-
Constructor Detail
-
ElPropertyChain
public ElPropertyChain(boolean containsMany, boolean embedded, String expression, ElPropertyValue[] chain)
-
-
Method Detail
-
getFetchPreference
public int getFetchPreference()
Description copied from interface:ElPropertyDeploy
Return the fetch preference. This can be used to control which ToMany relationship is left as a 'join' and which get converted to query join.- Specified by:
getFetchPreference
in interfaceElPropertyDeploy
-
isAggregation
public boolean isAggregation()
Description copied from interface:ElPropertyDeploy
Return true if this is an aggregation property.- Specified by:
isAggregation
in interfaceElPropertyDeploy
-
containsManySince
public boolean containsManySince(String sinceProperty)
Return true if there is a many property from sinceProperty to the end of this chain.- Specified by:
containsManySince
in interfaceElPropertyDeploy
-
containsFormulaWithJoin
public boolean containsFormulaWithJoin()
Description copied from interface:ElPropertyDeploy
Return true if the property is a formula with a join clause.- Specified by:
containsFormulaWithJoin
in interfaceElPropertyDeploy
-
containsMany
public boolean containsMany()
Description copied from interface:ElPropertyDeploy
Return true if there is a property on the path that is a many property.- Specified by:
containsMany
in interfaceElPropertyDeploy
- Specified by:
containsMany
in interfaceExpressionPath
-
getElPrefix
public String getElPrefix()
Description copied from interface:ElPropertyDeploy
Return the prefix path of the property.This is use to determine joins required to support this property.
- Specified by:
getElPrefix
in interfaceElPropertyDeploy
-
getName
public String getName()
Description copied from interface:ElPropertyDeploy
Return the name of the property.- Specified by:
getName
in interfaceElPropertyDeploy
-
getElName
public String getElName()
Description copied from interface:ElPropertyDeploy
The ElPrefix plus name.- Specified by:
getElName
in interfaceElPropertyDeploy
- Specified by:
getElName
in interfaceExpressionPath
-
getElPlaceholder
public String getElPlaceholder(boolean encrypted)
Description copied from interface:ElPropertyDeploy
Return the place holder in the form of ${elPrefix}dbColumn.The ${elPrefix} is replaced by the appropriate table alias.
- Specified by:
getElPlaceholder
in interfaceElPropertyDeploy
-
isDbEncrypted
public boolean isDbEncrypted()
Description copied from interface:ElPropertyValue
Return true if the property is encrypted in the DB.- Specified by:
isDbEncrypted
in interfaceElPropertyValue
-
isLocalEncrypted
public boolean isLocalEncrypted()
Description copied from interface:ElPropertyValue
Return true if the property is encrypted via Java.- Specified by:
isLocalEncrypted
in interfaceElPropertyValue
-
localEncrypt
public Object localEncrypt(Object value)
Description copied from interface:ElPropertyValue
Encrypt the input value return the encrypted value.- Specified by:
localEncrypt
in interfaceElPropertyValue
-
getAssocIsEmpty
public String getAssocIsEmpty(SpiExpressionRequest request, String path)
Description copied from interface:ElPropertyValue
Return the logical where clause to support "Is empty".- Specified by:
getAssocIsEmpty
in interfaceElPropertyValue
-
getAssocIdValues
public Object[] getAssocIdValues(EntityBean bean)
Description copied from interface:ExpressionPath
Return the Id values for the given bean value.- Specified by:
getAssocIdValues
in interfaceExpressionPath
-
getAssocIdExpression
public String getAssocIdExpression(String prefix, String operator)
Description copied from interface:ExpressionPath
Return the Id expression string.Typically used to produce id = ? expression strings.
- Specified by:
getAssocIdExpression
in interfaceExpressionPath
-
getAssocIdInExpr
public String getAssocIdInExpr(String prefix)
Description copied from interface:ElPropertyValue
Return the logical id in expression taking into account embedded id's.- Specified by:
getAssocIdInExpr
in interfaceElPropertyValue
-
getAssocIdInValueExpr
public String getAssocIdInValueExpr(boolean not, int size)
Description copied from interface:ElPropertyValue
Return the logical id value expression taking into account embedded id's.- Specified by:
getAssocIdInValueExpr
in interfaceElPropertyValue
-
isAssocMany
public boolean isAssocMany()
Description copied from interface:ElPropertyValue
Return true if the property is a OneToMany or ManyToMany associated bean property.- Specified by:
isAssocMany
in interfaceElPropertyValue
-
getProperty
public Property getProperty()
Description copied from interface:ExpressionPath
Return the underlying bean property.- Specified by:
getProperty
in interfaceExpressionPath
-
isAssocId
public boolean isAssocId()
Description copied from interface:ElPropertyValue
Return true if this is an ManyToOne or OneToOne associated bean property.- Specified by:
isAssocId
in interfaceElPropertyValue
- Specified by:
isAssocId
in interfaceExpressionPath
-
isAssocProperty
public boolean isAssocProperty()
Description copied from interface:ElPropertyValue
Return true if any path of this path contains a Associated One or Many.- Specified by:
isAssocProperty
in interfaceElPropertyValue
-
getDbColumn
public String getDbColumn()
Description copied from interface:ElPropertyDeploy
Return the deployment db column for this property.- Specified by:
getDbColumn
in interfaceElPropertyDeploy
-
getBeanProperty
public BeanProperty getBeanProperty()
Description copied from interface:ElPropertyDeploy
Return the underlying bean property.- Specified by:
getBeanProperty
in interfaceElPropertyDeploy
-
isDateTimeCapable
public boolean isDateTimeCapable()
Description copied from interface:ExpressionPath
Return true if the last type is "DateTime capable" - can supportExpressionPath.parseDateTime(long)
.- Specified by:
isDateTimeCapable
in interfaceExpressionPath
-
getJdbcType
public int getJdbcType()
Description copied from interface:ExpressionPath
Return the underlying JDBC type or 0 if this is not a scalar type.- Specified by:
getJdbcType
in interfaceExpressionPath
-
parseDateTime
public Object parseDateTime(long systemTimeMillis)
Description copied from interface:ExpressionPath
For DateTime capable scalar types convert the long systemTimeMillis into an appropriate java time (Date,Timestamp,Time,Calendar, JODA type etc).- Specified by:
parseDateTime
in interfaceExpressionPath
-
getStringParser
public StringParser getStringParser()
Description copied from interface:ExpressionPath
Return the default StringParser for the scalar property.- Specified by:
getStringParser
in interfaceExpressionPath
-
convert
public Object convert(Object value)
Description copied from interface:ExpressionPath
Convert the value to the expected type.Typically useful for converting strings to the appropriate number type etc.
- Specified by:
convert
in interfaceExpressionPath
-
pathGet
public Object pathGet(Object bean)
Description copied from interface:ExpressionPath
Return the value from a given entity bean.- Specified by:
pathGet
in interfaceExpressionPath
-
pathGetNested
public Object pathGetNested(Object bean)
Description copied from interface:ElPropertyValue
Return the value ensuring objects prior to the top scalar property are automatically populated.- Specified by:
pathGetNested
in interfaceElPropertyValue
-
pathSet
public void pathSet(Object bean, Object value)
Description copied from interface:ExpressionPath
Set a value to the bean for this expression path.- Specified by:
pathSet
in interfaceExpressionPath
- Parameters:
bean
- the bean to set the value onvalue
- the value to set
-
-