public class BeanProperty extends Object implements ElPropertyValue
| Type | Property and Description |
|---|---|
boolean |
isAssoc
Return true if any path of this path contains a Associated One or Many.
|
| Modifier and Type | Field and Description |
|---|---|
static String |
EXCLUDE_FROM_DELETE_WHERE
Advanced bean deployment.
|
static String |
EXCLUDE_FROM_INSERT
Advanced bean deployment.
|
static String |
EXCLUDE_FROM_UPDATE
Advanced bean deployment.
|
static String |
EXCLUDE_FROM_UPDATE_WHERE
Advanced bean deployment.
|
ROOT_ELPREFIX| Constructor and Description |
|---|
BeanProperty(BeanDescriptorMap owner,
BeanDescriptor<?> descriptor,
DeployBeanProperty deploy) |
BeanProperty(BeanProperty source,
BeanPropertyOverride override)
Create a Matching BeanProperty with some attributes overridden.
|
BeanProperty(DeployBeanProperty deploy) |
| Modifier and Type | Method and Description |
|---|---|
void |
appendFrom(DbSqlContext ctx,
boolean forceOuterJoin)
Add any extra joins required to support this property.
|
void |
appendSelect(DbSqlContext ctx,
boolean subQuery) |
void |
bind(DataBind b,
Object value) |
ElPropertyValue |
buildElPropertyValue(String propName,
String remainder,
ElPropertyChainBuilder chain,
boolean propertyDeploy) |
void |
buildSelectExpressionChain(String prefix,
List<String> selectChain) |
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 |
convertToLogicalType(Object value)
Perform DB to Logical type conversion (if necessary).
|
void |
copyProperty(Object sourceBean,
Object destBean) |
Object |
elConvertType(Object value)
Convert the value to the expected type.
|
Object |
elGetReference(Object bean)
Return the value ensuring objects prior to the top scalar property are
automatically populated.
|
Object |
elGetValue(Object bean)
Return the value from a given entity bean.
|
void |
elSetReference(Object bean)
Make the owning bean of this property a reference (as in not new/dirty).
|
void |
elSetValue(Object bean,
Object value,
boolean populate,
boolean reference)
Set a value given a root level bean.
|
String |
getAssocIdInExpr(String prefix)
Return the logical id in expression taking into account embedded id's.
|
String |
getAssocIdInValueExpr(int size)
Return the logical id value expression taking into account embedded id's.
|
String |
getAssocOneIdExpr(String prefix,
String operator)
Return the Id expression string.
|
Object[] |
getAssocOneIdValues(Object bean)
Return the Id values for the given bean value.
|
BeanDescriptor<?> |
getBeanDescriptor()
Return the BeanDescriptor that owns this property.
|
BeanProperty |
getBeanProperty()
Return the underlying bean property.
|
Object |
getCacheDataValue(Object bean) |
String |
getDbBind()
Return the DB bind parameter.
|
String |
getDbColumn()
The database column name this is mapped to.
|
String |
getDbColumnDefn()
Return a specific column DDL definition if specified (otherwise null).
|
String |
getDbConstraintExpression()
Return the DB constraint expression (can be null).
|
int |
getDbEncryptedType() |
int |
getDbLength()
Return the DB max length (varchar) or precision (decimal).
|
int |
getDbScale()
Return the DB scale for numeric columns.
|
int |
getDbType()
Return the database jdbc data type this is mapped to.
|
String |
getDecryptProperty() |
String |
getDecryptProperty(String propertyName) |
String |
getDecryptSql() |
String |
getDecryptSql(String tableAlias) |
Object |
getDefaultValue()
Return the default value.
|
int |
getDeployOrder()
Return the order this property appears in the bean.
|
String |
getDeployProperty() |
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 |
getExtraAttribute(String key)
Return an extra attribute set on this property.
|
Field |
getField()
Return the bean Field associated with this property.
|
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.
|
Class<?> |
getPropertyType()
Return the property type.
|
Method |
getReadMethod()
Return the getter method.
|
ScalarType<?> |
getScalarType()
Return the scalarType.
|
String |
getSecondaryTableJoinPrefix()
Returns null unless this property is using a secondary table.
|
StringFormatter |
getStringFormatter()
Return the default StringFormatter for the scalar property.
|
StringParser |
getStringParser()
Return the default StringParser for the scalar property.
|
Object |
getValue(Object bean)
Return the value of the property method.
|
Object |
getValueIntercept(Object bean) |
Object |
getValueViaReflection(Object bean)
Explicitly use reflection to get value.
|
Object |
getValueWithInheritance(Object bean)
Return the property value taking inheritance into account.
|
Method |
getWriteMethod()
Return the setter method.
|
boolean |
hasChanged(Object bean,
Object oldValues) |
void |
initialise()
Initialise the property before returning to client code.
|
boolean |
isAssignableFrom(Class<?> type) |
boolean |
isAssocId()
Return true if this is an ManyToOne or OneToOne associated bean property.
|
boolean |
isAssocProperty()
Return true if any path of this path contains a Associated One or Many.
|
boolean |
isCascadeValidate() |
boolean |
isDateTimeCapable()
Return true if the last type is "DateTime capable" - can support
ElPropertyValue.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 |
isDbRead()
Return true if this property is included in database queries.
|
boolean |
isDbUpdatable()
Return true if this property should be included in an Update.
|
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 |
isDeployOnly()
This is a full ElGetValue.
|
boolean |
isEmbedded()
Return true if this is an Embedded property.
|
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 |
isId()
Return true if this is included in the unique id.
|
boolean |
isInherited()
Return true if this object is part of an inheritance hierarchy.
|
boolean |
isLob()
Return true if this is mapped to a Clob Blob LongVarchar or
LongVarbinary.
|
boolean |
isLocal()
Return true is this type is not from a super type.
|
boolean |
isLocalEncrypted()
Returns true if DB encrypted.
|
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 |
isTransient()
Return true if the property is transient.
|
boolean |
isUnique()
Return true if the DB column should be unique.
|
boolean |
isValueLoaded(Object value)
Checks to see if a bean is a reference (will be lazy loaded) or a
BeanCollection that has not yet been populated.
|
boolean |
isVersion()
Return true if this is a version column used for concurrency checking.
|
void |
jsonRead(ReadJsonContext ctx,
Object bean) |
void |
jsonWrite(WriteJsonContext ctx,
Object bean) |
void |
load(SqlBeanLoad sqlBeanLoad) |
void |
loadIgnore(DbReadContext ctx) |
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 |
read(DbReadContext ctx) |
Object |
readData(DataInput dataInput) |
Object |
readSet(DbReadContext ctx,
Object bean,
Class<?> type) |
Object |
readSetOwning(DbReadContext ctx,
Object bean,
Class<?> type) |
String |
renderDbType(DbType dbType)
Return the DB column type definition.
|
void |
setCacheDataValue(Object bean,
Object cacheData,
Object oldValues,
boolean readOnly) |
void |
setDeployOrder(int deployOrder)
Set the order this property appears in the bean.
|
void |
setValue(Object bean,
Object value)
Set the value of the property without interception or
PropertyChangeSupport.
|
void |
setValueIntercept(Object bean,
Object value)
Set the value of the property.
|
Object |
toBeanType(Object value)
Convert the type to the bean type if required.
|
String |
toString() |
void |
writeData(DataOutput dataOutput,
Object value) |
isAssocProperty in interface ElPropertyValuepublic static final String EXCLUDE_FROM_UPDATE_WHERE
public static final String EXCLUDE_FROM_DELETE_WHERE
public static final String EXCLUDE_FROM_INSERT
public static final String EXCLUDE_FROM_UPDATE
public BeanProperty(DeployBeanProperty deploy)
public BeanProperty(BeanDescriptorMap owner, BeanDescriptor<?> descriptor, DeployBeanProperty deploy)
public BeanProperty(BeanProperty source, BeanPropertyOverride override)
Primarily for supporting Embedded beans with overridden dbColumn mappings.
public void initialise()
public int getDeployOrder()
getDeployOrder in interface ElPropertyValuepublic void setDeployOrder(int deployOrder)
public ElPropertyValue buildElPropertyValue(String propName, String remainder, ElPropertyChainBuilder chain, boolean propertyDeploy)
public BeanDescriptor<?> getBeanDescriptor()
public boolean isScalar()
public boolean isFormula()
public EncryptKey getEncryptKey()
public String getDecryptProperty()
public String getDecryptSql()
public void appendFrom(DbSqlContext ctx, boolean forceOuterJoin)
public String getSecondaryTableJoinPrefix()
public void appendSelect(DbSqlContext ctx, boolean subQuery)
public boolean isAssignableFrom(Class<?> type)
public Object readSetOwning(DbReadContext ctx, Object bean, Class<?> type) throws SQLException
SQLExceptionpublic void loadIgnore(DbReadContext ctx)
public void load(SqlBeanLoad sqlBeanLoad) throws SQLException
SQLExceptionpublic void buildSelectExpressionChain(String prefix, List<String> selectChain)
public Object read(DbReadContext ctx) throws SQLException
SQLExceptionpublic Object readSet(DbReadContext ctx, Object bean, Class<?> type) throws SQLException
SQLExceptionpublic Object toBeanType(Object value)
Generally only used to ensure id properties are converted for Query.setId() use.
public void bind(DataBind b, Object value) throws SQLException
SQLExceptionpublic void writeData(DataOutput dataOutput, Object value) throws IOException
IOExceptionpublic Object readData(DataInput dataInput) throws IOException
IOExceptionpublic boolean isCascadeValidate()
public boolean isValueLoaded(Object value)
For base types this returns true.
public BeanProperty getBeanProperty()
ElPropertyDeploygetBeanProperty in interface ElPropertyDeploypublic Method getReadMethod()
public Method getWriteMethod()
public boolean isInherited()
public boolean isLocal()
public void setValue(Object bean, Object value)
public void setValueIntercept(Object bean, Object value)
public Object getValueWithInheritance(Object bean)
public void setCacheDataValue(Object bean, Object cacheData, Object oldValues, boolean readOnly)
public Object getValueViaReflection(Object bean)
public Object elConvertType(Object value)
ElPropertyValueTypically useful for converting strings to the appropriate number type etc.
elConvertType in interface ElPropertyValuepublic void elSetReference(Object bean)
ElPropertyValueelSetReference in interface ElPropertyValuepublic void elSetValue(Object bean, Object value, boolean populate, boolean reference)
ElPropertyValueIf populate then
elSetValue in interface ElPropertyValuepublic Object elGetValue(Object bean)
ElPropertyValueelGetValue in interface ElPropertyValuepublic Object elGetReference(Object bean)
ElPropertyValueelGetReference in interface ElPropertyValuepublic String getName()
getName in interface ElPropertyDeploypublic String getElName()
ElPropertyDeploygetElName in interface ElPropertyDeploypublic boolean isDeployOnly()
public boolean containsFormulaWithJoin()
ElPropertyDeploycontainsFormulaWithJoin in interface ElPropertyDeploypublic boolean containsManySince(String sinceProperty)
ElPropertyDeploycontainsManySince in interface ElPropertyDeploypublic boolean containsMany()
ElPropertyDeploycontainsMany in interface ElPropertyDeploypublic Object[] getAssocOneIdValues(Object bean)
ElPropertyValuegetAssocOneIdValues in interface ElPropertyValuepublic String getAssocOneIdExpr(String prefix, String operator)
ElPropertyValueTypically used to produce id = ? expression strings.
getAssocOneIdExpr in interface ElPropertyValuepublic String getAssocIdInExpr(String prefix)
ElPropertyValuegetAssocIdInExpr in interface ElPropertyValuepublic String getAssocIdInValueExpr(int size)
ElPropertyValuegetAssocIdInValueExpr in interface ElPropertyValuepublic boolean isAssocId()
ElPropertyValueisAssocId in interface ElPropertyValuepublic boolean isAssocProperty()
ElPropertyValueisAssocProperty in interface ElPropertyValuepublic String getElPlaceholder(boolean encrypted)
ElPropertyDeployThe ${elPrefix} is replaced by the appropriate table alias.
getElPlaceholder in interface ElPropertyDeploypublic String getElPrefix()
ElPropertyDeployThis is use to determine joins required to support this property.
getElPrefix in interface ElPropertyDeploypublic String getFullBeanName()
public ScalarType<?> getScalarType()
public StringFormatter getStringFormatter()
ElPropertyValuegetStringFormatter in interface ElPropertyValuepublic StringParser getStringParser()
ElPropertyValuegetStringParser in interface ElPropertyValuepublic boolean isDateTimeCapable()
ElPropertyValueElPropertyValue.parseDateTime(long).isDateTimeCapable in interface ElPropertyValuepublic int getJdbcType()
ElPropertyValuegetJdbcType in interface ElPropertyValuepublic Object parseDateTime(long systemTimeMillis)
ElPropertyValueparseDateTime in interface ElPropertyValuepublic int getDbLength()
public int getDbScale()
public String getDbColumnDefn()
public String getDbConstraintExpression()
For an Enum returns IN expression for the set of Enum values.
public Field getField()
public GeneratedProperty getGeneratedProperty()
public boolean isNaturalKey()
public boolean isNullable()
public boolean isDDLNotNull()
public boolean isUnique()
public boolean isTransient()
public boolean isVersion()
public String getDeployProperty()
public String getDbColumn()
getDbColumn in interface ElPropertyDeploypublic int getDbType()
public Object convertToLogicalType(Object value)
public boolean isFetchEager()
public boolean isLob()
public String getDbBind()
public boolean isLocalEncrypted()
isLocalEncrypted in interface ElPropertyValuepublic boolean isDbEncrypted()
isDbEncrypted in interface ElPropertyValuepublic int getDbEncryptedType()
public boolean isDbInsertable()
public boolean isDbUpdatable()
public boolean isDbRead()
public boolean isSecondaryTable()
public Class<?> getPropertyType()
public boolean isId()
public boolean isEmbedded()
public String getExtraAttribute(String key)
public Object getDefaultValue()
public void jsonWrite(WriteJsonContext ctx, Object bean)
public void jsonRead(ReadJsonContext ctx, Object bean)
Copyright © 2014. All Rights Reserved.