Package io.ebeaninternal.server.deploy
Class BeanProperty
- java.lang.Object
-
- io.ebeaninternal.server.deploy.BeanProperty
-
- All Implemented Interfaces:
ExpressionPath
,Property
,ElPropertyDeploy
,ElPropertyValue
,STreeProperty
,ScalarDataReader<Object>
- Direct Known Subclasses:
BeanPropertyAssoc
,BeanPropertyOrderColumn
public class BeanProperty extends Object implements ElPropertyValue, Property, STreeProperty
Description of a property of a bean. Includes its deployment information such as database column mapping information.
-
-
Field Summary
-
Fields inherited from interface io.ebeaninternal.server.el.ElPropertyDeploy
ROOT_ELPREFIX
-
-
Constructor Summary
Constructors Constructor Description BeanProperty(BeanDescriptor<?> descriptor, DeployBeanProperty deploy)
BeanProperty(BeanProperty source, io.ebeaninternal.server.deploy.BeanPropertyOverride override)
Create a Matching BeanProperty with some attributes overridden.BeanProperty(DeployBeanProperty deploy)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addTenant(SpiQuery<?> query, Object tenantId)
Add the tenantId predicate to the query.void
appendFrom(DbSqlContext ctx, SqlJoinType joinType)
Add any extra joins required to support this property.void
appendSelect(DbSqlContext ctx, boolean subQuery)
Append to the select clause.void
bind(DataBind b, Object value)
ElPropertyValue
buildElPropertyValue(String propName, String remainder, ElPropertyChainBuilder chain, boolean propertyDeploy)
void
buildRawSqlSelectChain(String prefix, List<String> selectChain)
For RawSql build the select chain.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 property is on the path after sinceProperty that is a 'many' property.Object
convert(Object value)
Convert the value to the expected type.void
diff(String prefix, Map<String,ValuePair> map, EntityBean newBean, EntityBean oldBean)
Populate diff map comparing the property values between the beans.void
docStoreInclude(boolean includeByDefault, DocStructure docStructure)
Append this property to the document store based on includeByDefault setting.void
docStoreMapping(DocMappingBuilder mapping, String prefix)
Add to the document mapping if this property is included for this index.String
format(Object value)
Return the value in String format (for bean cache key).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".BeanDescriptor<?>
getBeanDescriptor()
Return the BeanDescriptor that owns this property.BeanProperty
getBeanProperty()
Return the underlying bean property.Object
getCacheDataValue(EntityBean bean)
Return the value for this property which we hold in the L2 cache entry.String
getDbBind()
Return the DB bind parameter.Set<String>
getDbCheckConstraintValues()
Return the DB constraint expression (can be null).String
getDbColumn()
The database column name this is mapped to.String
getDbColumnDefault()
Return the DB column default to use for DDL.String
getDbComment()
Return the comment for the associated DB column.int
getDbEncryptedType()
int
getDbLength()
Return the DB max length (varchar) or precision (decimal).List<DbMigrationInfo>
getDbMigrationInfos()
Return the DDL-Migration Infosint
getDbType(boolean platformTypes)
Return the database jdbc data type this is mapped to.String
getDecryptProperty(String propertyName)
int
getDeployOrder()
Return the order this property appears in the bean.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.EncryptKey
getEncryptKey()
Return the encrypt key for the column matching this property.String
getEncryptKeyAsString()
Return the encryption key as a string value (when the property is encrypted).int
getFetchPreference()
Return the fetch preference.String
getFullBeanName()
Return the full name of this property.GeneratedProperty
getGeneratedProperty()
Return the GeneratedValue.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.int
getPropertyIndex()
Return the position of this property in the enhanced bean.Class<?>
getPropertyType()
Return the property type.ScalarType<Object>
getScalarType()
Return the scalarType.String
getSecondaryTableJoinPrefix()
Returns null unless this property is using a secondary table.StringParser
getStringParser()
Return the default StringParser for the scalar property.Object
getVal(Object bean)
Return the value of the property on the given bean.Object
getValue(EntityBean bean)
Return the value of the property method.Object
getValueIntercept(EntityBean bean)
void
initialise(io.ebeaninternal.server.deploy.BeanDescriptorInitContext initContext)
Initialise the property before returning to client code.boolean
isAggregation()
Return true if this is an aggregation property.boolean
isAssignableFrom(Class<?> type)
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
isCacheDataInclude()
Return true if this property should be included in the cache bean data.boolean
isDateTimeCapable()
Return true if the last type is "DateTime capable" - can supportExpressionPath.parseDateTime(long)
.boolean
isDbEncrypted()
Return true if this property is stored encrypted.boolean
isDbInsertable()
Return true if this property should be included in an Insert.boolean
isDbUpdatable()
Return true if this property should be included in an Update.boolean
isDDLColumn()
Return true if this property should have a DB Column created in DDL.boolean
isDDLNotNull()
Return true if DDL Not NULL constraint should be defined for this column based on it being a version column or having a generated property.boolean
isDiscriminator()
Return true if this property maps to the inheritance discriminator column.boolean
isDraft()
Return true if this property is a boolean flag on a draftable bean indicating if the instance is a draft or live bean.boolean
isDraftDirty()
Return true if this property is a boolean flag only on the draft table indicating that when the draft is different from the published row.boolean
isDraftOnly()
Return true if this property only exists on the draft table.boolean
isEmbedded()
Return true if this is an Embedded property.boolean
isExcludedFromHistory()
Return true if this property is excluded from history.boolean
isFetchEager()
Return true if by default this property is set to fetch eager.boolean
isFormula()
Return true if this property is based on a formula.boolean
isGenerated()
Return true if this is a generated or Id property.boolean
isId()
Return true if this is included in the unique id.boolean
isImportedPrimaryKey()
If true this bean maps to the primary key.boolean
isJsonSerialize()
boolean
isLoadProperty(boolean draftQuery)
Return true if this property is loadable from a resultSet.boolean
isLob()
Return true if this is mapped to a Clob Blob LongVarchar or LongVarbinary.static boolean
isLobType(int type)
boolean
isLocal()
Return true is this type is not from a super type.boolean
isLocalEncrypted()
Returns true if DB encrypted.boolean
isMany()
Return true if this is a OneToMany or ManyToMany property.boolean
isMutableScalarType()
Return true if the underlying type is mutable.boolean
isNaturalKey()
Return true if this is the natural key property.boolean
isNullable()
Return true if this property is mandatory.boolean
isScalar()
Return true is this is a simple scalar property.boolean
isSecondaryTable()
Return true if this property is based on a secondary table (not the base table).boolean
isSoftDelete()
Return true if this property is the soft delete property.boolean
isTenantId()
Return true if this is the tenantId property (for multi-tenant partitioning).boolean
isTransient()
Return true if the property is transient.boolean
isUnique()
Return true if the DB column should be unique.boolean
isUnmappedJson()
Return true if this property hold unmapped JSON.boolean
isVersion()
Return true if this is a version column used for concurrency checking.void
jsonRead(SpiJsonReader ctx, EntityBean bean)
void
jsonWrite(SpiJsonWriter writeJson, EntityBean bean)
JSON write the bean property.void
jsonWriteForInsert(SpiJsonWriter writeJson, EntityBean bean)
JSON write the property for 'insert only depth'.void
jsonWriteValue(SpiJsonWriter writeJson, Object value)
JSON write the property value.void
load(SqlBeanLoad sqlBeanLoad)
Load into the bean (from the DataReader/ResultSet).void
loadIgnore(DbReadContext ctx)
Ignore the property (moving the column index position without reading).Object
localEncrypt(Object value)
Encrypt the input value return the encrypted value.void
merge(EntityBean bean, EntityBean existing)
Object
parse(String value)
Return the value from String format into Object 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.void
publish(EntityBean draftBean, EntityBean liveBean)
Copy/set the property value from the draft bean to the live bean.Object
read(DbReadContext ctx)
Object
read(DataReader reader)
Read and return the appropriate value from the dataReader.Object
readData(DataInput dataInput)
Object
readSet(DbReadContext ctx, EntityBean bean)
Object
readSet(DataReader reader, EntityBean bean)
void
registerColumn(BeanDescriptor<?> desc, String prefix)
String
renderDbType(DbPlatformType dbType, boolean strict)
Return the DB column type definition.void
setCacheDataValue(EntityBean bean, Object cacheData, PersistenceContext context)
Read the value for this property from L2 cache entry and set it to the bean.void
setDeployOrder(int deployOrder)
Set the order this property appears in the bean.void
setTenantValue(EntityBean entityBean, Object tenantId)
Set the tenantId onto the bean.void
setValue(EntityBean bean, Object value)
Set the value of the property without interception or PropertyChangeSupport.void
setValueChanged(EntityBean bean, Object value)
Set the changed value without invoking interception (lazy loading etc).void
setValueIntercept(EntityBean bean, Object value)
Set the value of the property.String
toString()
void
writeData(DataOutput dataOutput, Object value)
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface io.ebeaninternal.server.query.STreeProperty
isAggregationManyToOne
-
-
-
-
Constructor Detail
-
BeanProperty
public BeanProperty(DeployBeanProperty deploy)
-
BeanProperty
public BeanProperty(BeanDescriptor<?> descriptor, DeployBeanProperty deploy)
-
BeanProperty
public BeanProperty(BeanProperty source, io.ebeaninternal.server.deploy.BeanPropertyOverride override)
Create a Matching BeanProperty with some attributes overridden.Primarily for supporting Embedded beans with overridden dbColumn mappings.
-
-
Method Detail
-
initialise
public void initialise(io.ebeaninternal.server.deploy.BeanDescriptorInitContext initContext)
Initialise the property before returning to client code. Used to initialise variables that can't be done in construction due to recursive issues.
-
getDeployOrder
public int getDeployOrder()
Return the order this property appears in the bean.
-
setDeployOrder
public void setDeployOrder(int deployOrder)
Set the order this property appears in the bean.
-
buildElPropertyValue
public ElPropertyValue buildElPropertyValue(String propName, String remainder, ElPropertyChainBuilder chain, boolean propertyDeploy)
-
getBeanDescriptor
public BeanDescriptor<?> getBeanDescriptor()
Return the BeanDescriptor that owns this property.
-
isScalar
public boolean isScalar()
Return true is this is a simple scalar property.
-
isDDLColumn
public boolean isDDLColumn()
Return true if this property should have a DB Column created in DDL.
-
isFormula
public boolean isFormula()
Return true if this property is based on a formula.- Specified by:
isFormula
in interfaceSTreeProperty
-
isDiscriminator
public boolean isDiscriminator()
Return true if this property maps to the inheritance discriminator column.
-
isMutableScalarType
public boolean isMutableScalarType()
Return true if the underlying type is mutable.
-
getEncryptKey
public EncryptKey getEncryptKey()
Return the encrypt key for the column matching this property.
-
getEncryptKeyAsString
public String getEncryptKeyAsString()
Description copied from interface:STreeProperty
Return the encryption key as a string value (when the property is encrypted).- Specified by:
getEncryptKeyAsString
in interfaceSTreeProperty
-
getDecryptProperty
public String getDecryptProperty(String propertyName)
-
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
-
appendFrom
public void appendFrom(DbSqlContext ctx, SqlJoinType joinType)
Add any extra joins required to support this property. Generally a no operation except for a OneToOne exported.- Specified by:
appendFrom
in interfaceSTreeProperty
-
getSecondaryTableJoinPrefix
public String getSecondaryTableJoinPrefix()
Returns null unless this property is using a secondary table. In that case this returns the logical property prefix.
-
isAggregation
public boolean isAggregation()
Description copied from interface:ElPropertyDeploy
Return true if this is an aggregation property.- Specified by:
isAggregation
in interfaceElPropertyDeploy
- Specified by:
isAggregation
in interfaceSTreeProperty
-
appendSelect
public void appendSelect(DbSqlContext ctx, boolean subQuery)
Description copied from interface:STreeProperty
Append to the select clause.- Specified by:
appendSelect
in interfaceSTreeProperty
-
isMany
public boolean isMany()
Description copied from interface:Property
Return true if this is a OneToMany or ManyToMany property.
-
isAssignableFrom
public boolean isAssignableFrom(Class<?> type)
-
loadIgnore
public void loadIgnore(DbReadContext ctx)
Description copied from interface:STreeProperty
Ignore the property (moving the column index position without reading).- Specified by:
loadIgnore
in interfaceSTreeProperty
-
load
public void load(SqlBeanLoad sqlBeanLoad)
Description copied from interface:STreeProperty
Load into the bean (from the DataReader/ResultSet).- Specified by:
load
in interfaceSTreeProperty
-
buildRawSqlSelectChain
public void buildRawSqlSelectChain(String prefix, List<String> selectChain)
Description copied from interface:STreeProperty
For RawSql build the select chain.- Specified by:
buildRawSqlSelectChain
in interfaceSTreeProperty
-
read
public Object read(DataReader reader) throws SQLException
Description copied from interface:ScalarDataReader
Read and return the appropriate value from the dataReader.- Specified by:
read
in interfaceScalarDataReader<Object>
- Throws:
SQLException
-
readSet
public Object readSet(DataReader reader, EntityBean bean) throws SQLException
- Throws:
SQLException
-
read
public Object read(DbReadContext ctx) throws SQLException
- Throws:
SQLException
-
readSet
public Object readSet(DbReadContext ctx, EntityBean bean) throws SQLException
- Throws:
SQLException
-
bind
public void bind(DataBind b, Object value) throws SQLException
- Throws:
SQLException
-
writeData
public void writeData(DataOutput dataOutput, Object value) throws IOException
- Throws:
IOException
-
readData
public Object readData(DataInput dataInput) throws IOException
- Throws:
IOException
-
getBeanProperty
public BeanProperty getBeanProperty()
Description copied from interface:ElPropertyDeploy
Return the underlying bean property.- Specified by:
getBeanProperty
in interfaceElPropertyDeploy
-
getProperty
public Property getProperty()
Description copied from interface:ExpressionPath
Return the underlying bean property.- Specified by:
getProperty
in interfaceExpressionPath
-
isLocal
public boolean isLocal()
Return true is this type is not from a super type.
-
publish
public void publish(EntityBean draftBean, EntityBean liveBean)
Copy/set the property value from the draft bean to the live bean.
-
setValueChanged
public void setValueChanged(EntityBean bean, Object value)
Set the changed value without invoking interception (lazy loading etc). Typically used to set generated values on update.
-
addTenant
public void addTenant(SpiQuery<?> query, Object tenantId)
Add the tenantId predicate to the query.
-
setTenantValue
public void setTenantValue(EntityBean entityBean, Object tenantId)
Set the tenantId onto the bean.
-
setValue
public void setValue(EntityBean bean, Object value)
Set the value of the property without interception or PropertyChangeSupport.
-
setValueIntercept
public void setValueIntercept(EntityBean bean, Object value)
Set the value of the property.
-
isCacheDataInclude
public boolean isCacheDataInclude()
Return true if this property should be included in the cache bean data.
-
getCacheDataValue
public Object getCacheDataValue(EntityBean bean)
Return the value for this property which we hold in the L2 cache entry.This uses format() where possible to store the value as a string and this is done to make any resulting Java object serialisation content smaller as strings get special treatment.
-
setCacheDataValue
public void setCacheDataValue(EntityBean bean, Object cacheData, PersistenceContext context)
Read the value for this property from L2 cache entry and set it to the bean.This uses parse() as per the comment in getCacheDataValue().
-
getVal
public Object getVal(Object bean)
Description copied from interface:Property
Return the value of the property on the given bean.
-
getValue
public Object getValue(EntityBean bean)
Return the value of the property method.
-
getValueIntercept
public Object getValueIntercept(EntityBean bean)
-
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
-
getName
@Nonnull public String getName()
Return the name of the property.- Specified by:
getName
in interfaceElPropertyDeploy
- Specified by:
getName
in interfaceProperty
- Specified by:
getName
in interfaceSTreeProperty
-
getPropertyIndex
public int getPropertyIndex()
Return the position of this property in the enhanced bean.
-
getElName
public String getElName()
Description copied from interface:ElPropertyDeploy
The ElPrefix plus name.- Specified by:
getElName
in interfaceElPropertyDeploy
- Specified by:
getElName
in interfaceExpressionPath
-
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
-
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
-
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
-
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
-
isImportedPrimaryKey
public boolean isImportedPrimaryKey()
If true this bean maps to the primary key.
-
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()
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
-
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
- Specified by:
getElPrefix
in interfaceSTreeProperty
-
getFullBeanName
public String getFullBeanName()
Return the full name of this property.- Specified by:
getFullBeanName
in interfaceSTreeProperty
-
getScalarType
public ScalarType<Object> getScalarType()
Return the scalarType.- Specified by:
getScalarType
in interfaceSTreeProperty
-
getStringParser
public StringParser getStringParser()
Description copied from interface:ExpressionPath
Return the default StringParser for the scalar property.- Specified by:
getStringParser
in interfaceExpressionPath
-
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
-
getDbLength
public int getDbLength()
Return the DB max length (varchar) or precision (decimal).
-
getDbCheckConstraintValues
public Set<String> getDbCheckConstraintValues()
Return the DB constraint expression (can be null).For an Enum returns IN expression for the set of Enum values.
-
renderDbType
public String renderDbType(DbPlatformType dbType, boolean strict)
Return the DB column type definition.
-
getDbColumnDefault
public String getDbColumnDefault()
Return the DB column default to use for DDL.
-
getDbMigrationInfos
public List<DbMigrationInfo> getDbMigrationInfos()
Return the DDL-Migration Infos
-
getGeneratedProperty
public GeneratedProperty getGeneratedProperty()
Return the GeneratedValue. Used to generate update timestamp etc.
-
isNaturalKey
public boolean isNaturalKey()
Return true if this is the natural key property.
-
isNullable
public boolean isNullable()
Return true if this property is mandatory.
-
isDDLNotNull
public boolean isDDLNotNull()
Return true if DDL Not NULL constraint should be defined for this column based on it being a version column or having a generated property.
-
isGenerated
public boolean isGenerated()
Return true if this is a generated or Id property.
-
isUnique
public boolean isUnique()
Return true if the DB column should be unique.
-
isTransient
public boolean isTransient()
Return true if the property is transient.
-
isLoadProperty
public boolean isLoadProperty(boolean draftQuery)
Return true if this property is loadable from a resultSet.
-
isVersion
public boolean isVersion()
Return true if this is a version column used for concurrency checking.
-
getDbColumn
public String getDbColumn()
The database column name this is mapped to.- Specified by:
getDbColumn
in interfaceElPropertyDeploy
-
getDbComment
public String getDbComment()
Return the comment for the associated DB column.
-
getDbType
public int getDbType(boolean platformTypes)
Return the database jdbc data type this is mapped to.- Parameters:
platformTypes
- Set as false when we want logical platform agnostic types.
-
isFetchEager
public boolean isFetchEager()
Return true if by default this property is set to fetch eager. Lob's usually default to fetch lazy.
-
isLob
public boolean isLob()
Return true if this is mapped to a Clob Blob LongVarchar or LongVarbinary.
-
isLobType
public static boolean isLobType(int type)
-
getDbBind
public String getDbBind()
Return the DB bind parameter. Typically is "?" but different for encrypted bind.
-
localEncrypt
public Object localEncrypt(Object value)
Description copied from interface:ElPropertyValue
Encrypt the input value return the encrypted value.- Specified by:
localEncrypt
in interfaceElPropertyValue
-
isLocalEncrypted
public boolean isLocalEncrypted()
Returns true if DB encrypted.- Specified by:
isLocalEncrypted
in interfaceElPropertyValue
-
isDbEncrypted
public boolean isDbEncrypted()
Return true if this property is stored encrypted.- Specified by:
isDbEncrypted
in interfaceElPropertyValue
-
getDbEncryptedType
public int getDbEncryptedType()
-
isExcludedFromHistory
public boolean isExcludedFromHistory()
Return true if this property is excluded from history.
-
isUnmappedJson
public boolean isUnmappedJson()
Return true if this property hold unmapped JSON.
-
isTenantId
public boolean isTenantId()
Return true if this is the tenantId property (for multi-tenant partitioning).
-
isDraftOnly
public boolean isDraftOnly()
Return true if this property only exists on the draft table.
-
isDraft
public boolean isDraft()
Return true if this property is a boolean flag on a draftable bean indicating if the instance is a draft or live bean.
-
isDraftDirty
public boolean isDraftDirty()
Return true if this property is a boolean flag only on the draft table indicating that when the draft is different from the published row.
-
isSoftDelete
public boolean isSoftDelete()
Return true if this property is the soft delete property.
-
isDbInsertable
public boolean isDbInsertable()
Return true if this property should be included in an Insert.
-
isDbUpdatable
public boolean isDbUpdatable()
Return true if this property should be included in an Update.
-
isSecondaryTable
public boolean isSecondaryTable()
Return true if this property is based on a secondary table (not the base table).
-
getPropertyType
@Nonnull public Class<?> getPropertyType()
Return the property type.- Specified by:
getPropertyType
in interfaceProperty
-
isId
public boolean isId()
Return true if this is included in the unique id.- Specified by:
isId
in interfaceSTreeProperty
-
isEmbedded
public boolean isEmbedded()
Return true if this is an Embedded property. In this case it shares the table and primary key of its owner object.- Specified by:
isEmbedded
in interfaceSTreeProperty
-
docStoreInclude
public void docStoreInclude(boolean includeByDefault, DocStructure docStructure)
Append this property to the document store based on includeByDefault setting.
-
isJsonSerialize
public boolean isJsonSerialize()
-
jsonWriteForInsert
public void jsonWriteForInsert(SpiJsonWriter writeJson, EntityBean bean) throws IOException
JSON write the property for 'insert only depth'.- Throws:
IOException
-
jsonWriteValue
public void jsonWriteValue(SpiJsonWriter writeJson, Object value) throws IOException
JSON write the property value.- Throws:
IOException
-
jsonWrite
public void jsonWrite(SpiJsonWriter writeJson, EntityBean bean) throws IOException
JSON write the bean property.- Throws:
IOException
-
jsonRead
public void jsonRead(SpiJsonReader ctx, EntityBean bean) throws IOException
- Throws:
IOException
-
diff
public void diff(String prefix, Map<String,ValuePair> map, EntityBean newBean, EntityBean oldBean)
Populate diff map comparing the property values between the beans.
-
docStoreMapping
public void docStoreMapping(DocMappingBuilder mapping, String prefix)
Add to the document mapping if this property is included for this index.
-
merge
public void merge(EntityBean bean, EntityBean existing)
-
registerColumn
public void registerColumn(BeanDescriptor<?> desc, String prefix)
-
-