Package io.ebeaninternal.server.deploy
Class BeanFkeyProperty
- java.lang.Object
-
- io.ebeaninternal.server.deploy.BeanFkeyProperty
-
- All Implemented Interfaces:
ExpressionPath
,ElPropertyDeploy
,ElPropertyValue
public final class BeanFkeyProperty extends Object implements ElPropertyValue
Used to evaluate imported foreign keys so as to avoid unnecessary joins.
-
-
Field Summary
-
Fields inherited from interface io.ebeaninternal.server.el.ElPropertyDeploy
ROOT_ELPREFIX
-
-
Constructor Summary
Constructors Constructor Description BeanFkeyProperty(String name, String dbColumn, int deployOrder)
-
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()
Returns false.boolean
containsManySince(String sinceProperty)
Return true if there is a property is on the path after sinceProperty that is a 'many' property.Object
convert(Object value)
Convert the value to the expected type.BeanFkeyProperty
create(String expression, boolean pathContainsMany)
String
getAssocIdExpression(String prefix, String operator)
Returns null as not an AssocOne.String
getAssocIdInExpr(String prefix)
Returns null as not an AssocOne.String
getAssocIdInValueExpr(boolean not, int size)
Returns null as not an AssocOne.Object[]
getAssocIdValues(EntityBean value)
Returns null as not an AssocOne.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()
Returns false as not an AssocOne.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()
Returns false for keys.boolean
isLocalEncrypted()
Returns false for keys.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
-
BeanFkeyProperty
public BeanFkeyProperty(String name, String dbColumn, int deployOrder)
-
-
Method Detail
-
isAggregation
public boolean isAggregation()
Description copied from interface:ElPropertyDeploy
Return true if this is an aggregation property.- Specified by:
isAggregation
in interfaceElPropertyDeploy
-
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
-
create
public BeanFkeyProperty create(String expression, boolean pathContainsMany)
-
isDbEncrypted
public boolean isDbEncrypted()
Returns false for keys.- Specified by:
isDbEncrypted
in interfaceElPropertyValue
-
isLocalEncrypted
public boolean isLocalEncrypted()
Returns false for keys.- 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
-
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()
Returns false.- Specified by:
containsMany
in interfaceElPropertyDeploy
- Specified by:
containsMany
in interfaceExpressionPath
-
containsManySince
public boolean containsManySince(String sinceProperty)
Description copied from interface:ElPropertyDeploy
Return true if there is a property is on the path after sinceProperty that is a 'many' property.- Specified by:
containsManySince
in interfaceElPropertyDeploy
-
getDbColumn
public String getDbColumn()
Description copied from interface:ElPropertyDeploy
Return the deployment db column for this property.- Specified by:
getDbColumn
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
-
getAssocIdValues
public Object[] getAssocIdValues(EntityBean value)
Returns null as not an AssocOne.- Specified by:
getAssocIdValues
in interfaceExpressionPath
-
getAssocIdExpression
public String getAssocIdExpression(String prefix, String operator)
Returns null as not an AssocOne.- Specified by:
getAssocIdExpression
in interfaceExpressionPath
-
getAssocIdInExpr
public String getAssocIdInExpr(String prefix)
Returns null as not an AssocOne.- Specified by:
getAssocIdInExpr
in interfaceElPropertyValue
-
getAssocIdInValueExpr
public String getAssocIdInValueExpr(boolean not, int size)
Returns null as not an AssocOne.- Specified by:
getAssocIdInValueExpr
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
-
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
-
isAssocId
public boolean isAssocId()
Returns false as not an AssocOne.- 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
-
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
-
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
-
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
-
getBeanProperty
public BeanProperty getBeanProperty()
Description copied from interface:ElPropertyDeploy
Return the underlying bean property.- Specified by:
getBeanProperty
in interfaceElPropertyDeploy
-
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
-
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
-
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
-
getProperty
public Property getProperty()
Description copied from interface:ExpressionPath
Return the underlying bean property.- Specified by:
getProperty
in interfaceExpressionPath
-
-