Class DeployBeanProperty
- java.lang.Object
-
- io.ebeaninternal.server.deploy.meta.DeployBeanProperty
-
- Direct Known Subclasses:
DeployBeanPropertyAssoc
public class DeployBeanProperty extends Object
Description of a property of a bean. Includes its deployment information such as database column mapping information.
-
-
Constructor Summary
Constructors Constructor Description DeployBeanProperty(DeployBeanDescriptor<?> desc, Class<?> propertyType, ScalarType<?> scalarType, ScalarTypeConverter<?,?> typeConverter)
DeployBeanProperty(DeployBeanDescriptor<?> desc, Class<?> propertyType, Type genericType)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
addDbMigrationInfo(DbMigrationInfo info)
void
checkPrimitiveBoolean()
Primitive boolean check so see if not null default false should be applied.String
getDbBind()
Return the DB Bind parameter.String
getDbColumn()
The database column name this is mapped to.String
getDbColumnDefaultSqlLiteral()
Return the DB Column default taking into account literal translation.String
getDbColumnDefn()
Return the DB column definition if defined.String
getDbComment()
int
getDbEncryptedType()
Return the DB type for the encrypted property.DbEncryptFunction
getDbEncryptFunction()
int
getDbLength()
Return the DB column length for character columns.List<DbMigrationInfo>
getDbMigrationInfos()
int
getDbScale()
Return the Db scale for numeric columns.int
getDbType()
Return the database jdbc data type this is mapped to.DeployBeanDescriptor<?>
getDesc()
DocPropertyOptions
getDocPropertyOptions()
String
getElPlaceHolder()
String
getElPrefix()
Field
getField()
Return the bean Field associated with this property.String
getFullBeanName()
GeneratedProperty
getGeneratedProperty()
Return the GeneratedValue.Type
getGenericType()
Return the generic type for this property.BeanPropertyGetter
getGetter()
Object
getJacksonField()
Returns the jackson annotated field, if jackson is present.<A extends Annotation>
AgetMetaAnnotation(Class<A> annotationType)
io.ebean.annotation.Formula
getMetaAnnotationFormula(io.ebean.annotation.Platform platform)
<A extends Annotation>
List<A>getMetaAnnotations(Class<A> annotationType)
List<javax.validation.constraints.Size>
getMetaAnnotationSize()
io.ebean.annotation.Where
getMetaAnnotationWhere(io.ebean.annotation.Platform platform)
String
getName()
Return the name of the property.Class<?>
getOwningType()
int
getPropertyIndex()
Class<?>
getPropertyType()
Return the property type.String
getRawAggregation()
Get the raw/logical aggregation formula.ScalarType<?>
getScalarType()
Return the scalarType.String
getSecondaryTable()
Return the secondary table this property is associated with.DeployTableJoin
getSecondaryTableJoin()
String
getSecondaryTableJoinPrefix()
BeanPropertySetter
getSetter()
int
getSortOverride()
String
getSqlFormulaJoin()
String
getSqlFormulaSelect()
Return the formula this property is based on.void
initMetaAnnotations(Set<Class<?>> metaAnnotationsFilter)
boolean
isAggregation()
boolean
isDbEncrypted()
Return true if this property is encrypted in the DB.boolean
isDbInsertable()
boolean
isDbRead()
Return true if this property is included in database queries.boolean
isDbUpdateable()
boolean
isDiscriminator()
Return true if this property maps to the inheritance discriminator column.sboolean
isDraft()
boolean
isDraftDirty()
boolean
isDraftOnly()
boolean
isDraftReset()
boolean
isEmbedded()
Return true if this is an Embedded property.boolean
isExcludedFromHistory()
boolean
isFetchEager()
Return true if this should be eager fetched by default.boolean
isId()
Return true if this is included in the unique id.boolean
isIdClass()
boolean
isImportedPrimaryKey()
Return true if this is part of the primary key.boolean
isJsonDeserialize()
boolean
isJsonSerialize()
boolean
isLob()
Return true if this is mapped to a Clob Blob LongVarchar or LongVarbinary.boolean
isLocal()
Return true if this is local to this type - aka not from a super type.boolean
isLocalEncrypted()
Return true if the property is encrypted in java rather than in the DB.boolean
isNaturalKey()
boolean
isNullable()
Return true if this property is mandatory.boolean
isSecondaryTable()
Return true if this property is based on a secondary table.boolean
isSoftDelete()
boolean
isTenantId()
boolean
isTransient()
Return true if the property is transient.boolean
isUndirectionalShadow()
Return true if this is a placeholder property for a unidirectional relationship.boolean
isUnique()
Return true if the DB column is unique.boolean
isUnmappedJson()
boolean
isVersionColumn()
Return true if this is a version column used for concurrency checking.String
parseAggregation()
Get the parsed aggregation formula with table alias placeholders.void
setAggregation(String aggregation)
void
setAggregationPrefix(String prefix)
Set the path to the aggregation.void
setDbColumn(String dbColumn)
Set the database column name this is mapped to.void
setDbColumnDefault(String dbColumnDefault)
void
setDbColumnDefn(String dbColumnDefn)
Set a specific DB column definition.void
setDbComment(String dbComment)
void
setDbEncryptFunction(DbEncryptFunction dbEncryptFunction, DbEncrypt dbEncrypt, int dbLen)
void
setDbInsertable(boolean insertable)
void
setDbLength(int dbLength)
Set the DB column length for character columns.void
setDbRead(boolean isDBRead)
Set to true if this property is included in database queries.void
setDbScale(int dbScale)
Set the Db scale for numeric columns.void
setDbType(int dbType)
Set the database jdbc data type this is mapped to.void
setDbUpdateable(boolean updateable)
void
setDocCode(io.ebean.annotation.DocCode docCode)
void
setDocProperty(io.ebean.annotation.DocProperty docProperty)
void
setDocSortable(io.ebean.annotation.DocSortable docSortable)
void
setDraft()
void
setDraftDirty()
void
setDraftOnly()
void
setDraftReset()
void
setElementProperty()
Set when this property is part of a 'element bean' used with ElementCollection.void
setEmbedded()
Set to true if this is an embedded property.void
setExcludedFromHistory()
void
setFetchType(javax.persistence.FetchType fetchType)
Set the default fetch type for this property.void
setField(Field field)
Set the bean Field associated with this property.void
setGeneratedProperty(GeneratedProperty generatedValue)
Set the GeneratedValue.void
setGetter(BeanPropertyGetter getter)
Set the getter used to read the property value from a bean.void
setId()
Set to true if this is included in the unique id.void
setImportedPrimaryKey()
void
setImportedPrimaryKeyColumn(DeployBeanProperty primaryKey)
Set to true if this is part of the primary key.void
setJsonDeserialize(boolean jsonDeserialize)
void
setJsonSerialize(boolean jsonSerialize)
void
setLocalEncrypted()
Set to true when the property is encrypted in java rather than in the DB.void
setName(String name)
Set the name of the property.void
setNullable(boolean isNullable)
Set the not nullable of this property.void
setOwningType(Class<?> owningType)
Set to the owning type form a Inheritance heirarchy.void
setPropertyIndex(int propertyIndex)
void
setScalarType(ScalarType<?> scalarType)
void
setSecondaryTable(String secondaryTable)
Set to true if this property is included in persisting.void
setSecondaryTableJoin(DeployTableJoin secondaryTableJoin, String prefix)
void
setSetter(BeanPropertySetter setter)
Set the setter used to set the property value to a bean.void
setSoftDelete()
void
setSortOrder(int sortOrder)
Set the sortOrder for the properties.void
setSqlFormula(String formulaSelect, String formulaJoin)
The property is based on a formula.void
setTenantId()
void
setTransient()
Mark the property explicitly as a transient property.void
setUndirectionalShadow()
Mark this property as a placeholder for a unidirectional relationship.void
setUnique(boolean unique)
Set to true if the DB column is unique.void
setUnmappedJson()
void
setVersionColumn()
Set if this is a version column used for concurrency checking.String
toString()
-
-
-
Constructor Detail
-
DeployBeanProperty
public DeployBeanProperty(DeployBeanDescriptor<?> desc, Class<?> propertyType, ScalarType<?> scalarType, ScalarTypeConverter<?,?> typeConverter)
-
DeployBeanProperty
public DeployBeanProperty(DeployBeanDescriptor<?> desc, Class<?> propertyType, Type genericType)
-
-
Method Detail
-
getSortOverride
public int getSortOverride()
-
getFullBeanName
public String getFullBeanName()
-
getDesc
public DeployBeanDescriptor<?> getDesc()
-
getDbLength
public int getDbLength()
Return the DB column length for character columns.Note if there is no length explicitly defined then the scalarType is checked to see if that has one (primarily to support putting a length on Enum types).
-
isJsonSerialize
public boolean isJsonSerialize()
-
setJsonSerialize
public void setJsonSerialize(boolean jsonSerialize)
-
isJsonDeserialize
public boolean isJsonDeserialize()
-
setJsonDeserialize
public void setJsonDeserialize(boolean jsonDeserialize)
-
setSortOrder
public void setSortOrder(int sortOrder)
Set the sortOrder for the properties.
-
isUndirectionalShadow
public boolean isUndirectionalShadow()
Return true if this is a placeholder property for a unidirectional relationship.
-
setUndirectionalShadow
public void setUndirectionalShadow()
Mark this property as a placeholder for a unidirectional relationship.
-
isDiscriminator
public boolean isDiscriminator()
Return true if this property maps to the inheritance discriminator column.s
-
isLocalEncrypted
public boolean isLocalEncrypted()
Return true if the property is encrypted in java rather than in the DB.
-
setLocalEncrypted
public void setLocalEncrypted()
Set to true when the property is encrypted in java rather than in the DB.
-
setDbLength
public void setDbLength(int dbLength)
Set the DB column length for character columns.
-
getDbScale
public int getDbScale()
Return the Db scale for numeric columns.
-
setDbScale
public void setDbScale(int dbScale)
Set the Db scale for numeric columns.
-
getDbColumnDefn
public String getDbColumnDefn()
Return the DB column definition if defined.
-
setDbColumnDefn
public void setDbColumnDefn(String dbColumnDefn)
Set a specific DB column definition.
-
getScalarType
public ScalarType<?> getScalarType()
Return the scalarType. This returns null for native JDBC types, otherwise it is used to convert between logical types and jdbc types.
-
setScalarType
public void setScalarType(ScalarType<?> scalarType)
-
getPropertyIndex
public int getPropertyIndex()
-
setPropertyIndex
public void setPropertyIndex(int propertyIndex)
-
getGetter
public BeanPropertyGetter getGetter()
-
getSetter
public BeanPropertySetter getSetter()
-
setOwningType
public void setOwningType(Class<?> owningType)
Set to the owning type form a Inheritance heirarchy.
-
getOwningType
public Class<?> getOwningType()
-
isLocal
public boolean isLocal()
Return true if this is local to this type - aka not from a super type.
-
setGetter
public void setGetter(BeanPropertyGetter getter)
Set the getter used to read the property value from a bean.
-
setSetter
public void setSetter(BeanPropertySetter setter)
Set the setter used to set the property value to a bean.
-
isNaturalKey
public boolean isNaturalKey()
-
getGeneratedProperty
public GeneratedProperty getGeneratedProperty()
Return the GeneratedValue. Used to generate update timestamp etc.
-
setGeneratedProperty
public void setGeneratedProperty(GeneratedProperty generatedValue)
Set the GeneratedValue. Used to generate update timestamp etc.
-
isNullable
public boolean isNullable()
Return true if this property is mandatory.
-
setNullable
public void setNullable(boolean isNullable)
Set the not nullable of this property.
-
isUnique
public boolean isUnique()
Return true if the DB column is unique.
-
setUnique
public void setUnique(boolean unique)
Set to true if the DB column is unique.
-
isVersionColumn
public boolean isVersionColumn()
Return true if this is a version column used for concurrency checking.
-
setVersionColumn
public void setVersionColumn()
Set if this is a version column used for concurrency checking.
-
isFetchEager
public boolean isFetchEager()
Return true if this should be eager fetched by default.
-
setFetchType
public void setFetchType(javax.persistence.FetchType fetchType)
Set the default fetch type for this property.
-
getSqlFormulaSelect
public String getSqlFormulaSelect()
Return the formula this property is based on.
-
getSqlFormulaJoin
public String getSqlFormulaJoin()
-
setSqlFormula
public void setSqlFormula(String formulaSelect, String formulaJoin)
The property is based on a formula.
-
setImportedPrimaryKey
public void setImportedPrimaryKey()
-
setImportedPrimaryKeyColumn
public void setImportedPrimaryKeyColumn(DeployBeanProperty primaryKey)
Set to true if this is part of the primary key.
-
isAggregation
public boolean isAggregation()
-
getRawAggregation
public String getRawAggregation()
Get the raw/logical aggregation formula.
-
parseAggregation
public String parseAggregation()
Get the parsed aggregation formula with table alias placeholders.
-
setAggregation
public void setAggregation(String aggregation)
-
setAggregationPrefix
public void setAggregationPrefix(String prefix)
Set the path to the aggregation.
-
getElPrefix
public String getElPrefix()
-
getElPlaceHolder
public String getElPlaceHolder()
-
getDbColumn
public String getDbColumn()
The database column name this is mapped to.
-
setDbColumn
public void setDbColumn(String dbColumn)
Set the database column name this is mapped to.
-
getDbType
public int getDbType()
Return the database jdbc data type this is mapped to.
-
setDbType
public void setDbType(int dbType)
Set the database jdbc data type this is mapped to.
-
isLob
public boolean isLob()
Return true if this is mapped to a Clob Blob LongVarchar or LongVarbinary.
-
isSecondaryTable
public boolean isSecondaryTable()
Return true if this property is based on a secondary table.
-
getSecondaryTable
public String getSecondaryTable()
Return the secondary table this property is associated with.
-
setSecondaryTable
public void setSecondaryTable(String secondaryTable)
Set to true if this property is included in persisting.
-
getSecondaryTableJoinPrefix
public String getSecondaryTableJoinPrefix()
-
getSecondaryTableJoin
public DeployTableJoin getSecondaryTableJoin()
-
setSecondaryTableJoin
public void setSecondaryTableJoin(DeployTableJoin secondaryTableJoin, String prefix)
-
getDbBind
public String getDbBind()
Return the DB Bind parameter. Typically is "?" but can be different for encrypted bind.
-
isDbEncrypted
public boolean isDbEncrypted()
Return true if this property is encrypted in the DB.
-
getDbEncryptFunction
public DbEncryptFunction getDbEncryptFunction()
-
setDbEncryptFunction
public void setDbEncryptFunction(DbEncryptFunction dbEncryptFunction, DbEncrypt dbEncrypt, int dbLen)
-
getDbEncryptedType
public int getDbEncryptedType()
Return the DB type for the encrypted property. This can differ from the logical type (String encrypted and stored in a VARBINARY)
-
isDbRead
public boolean isDbRead()
Return true if this property is included in database queries.
-
setDbRead
public void setDbRead(boolean isDBRead)
Set to true if this property is included in database queries.
-
isDbInsertable
public boolean isDbInsertable()
-
setDbInsertable
public void setDbInsertable(boolean insertable)
-
isDbUpdateable
public boolean isDbUpdateable()
-
setDbUpdateable
public void setDbUpdateable(boolean updateable)
-
isTransient
public boolean isTransient()
Return true if the property is transient.
-
setTransient
public void setTransient()
Mark the property explicitly as a transient property.
-
getPropertyType
public Class<?> getPropertyType()
Return the property type.
-
getGenericType
public Type getGenericType()
Return the generic type for this property.
-
isImportedPrimaryKey
public boolean isImportedPrimaryKey()
Return true if this is part of the primary key.
-
isId
public boolean isId()
Return true if this is included in the unique id.
-
setId
public void setId()
Set to true if this is included in the unique id.
-
isEmbedded
public boolean isEmbedded()
Return true if this is an Embedded property. In this case it shares the table and pk of its owner object.
-
setEmbedded
public void setEmbedded()
Set to true if this is an embedded property.
-
isExcludedFromHistory
public boolean isExcludedFromHistory()
-
setExcludedFromHistory
public void setExcludedFromHistory()
-
setDraft
public void setDraft()
-
isDraft
public boolean isDraft()
-
setDraftOnly
public void setDraftOnly()
-
isDraftOnly
public boolean isDraftOnly()
-
setDraftDirty
public void setDraftDirty()
-
isDraftDirty
public boolean isDraftDirty()
-
setDraftReset
public void setDraftReset()
-
isDraftReset
public boolean isDraftReset()
-
checkPrimitiveBoolean
public void checkPrimitiveBoolean()
Primitive boolean check so see if not null default false should be applied.
-
setSoftDelete
public void setSoftDelete()
-
isSoftDelete
public boolean isSoftDelete()
-
setUnmappedJson
public void setUnmappedJson()
-
isUnmappedJson
public boolean isUnmappedJson()
-
setDbComment
public void setDbComment(String dbComment)
-
getDbComment
public String getDbComment()
-
setDocProperty
public void setDocProperty(io.ebean.annotation.DocProperty docProperty)
-
setDocSortable
public void setDocSortable(io.ebean.annotation.DocSortable docSortable)
-
setDocCode
public void setDocCode(io.ebean.annotation.DocCode docCode)
-
getDocPropertyOptions
public DocPropertyOptions getDocPropertyOptions()
-
getDbColumnDefaultSqlLiteral
public String getDbColumnDefaultSqlLiteral()
Return the DB Column default taking into account literal translation.
-
setDbColumnDefault
public void setDbColumnDefault(String dbColumnDefault)
-
setTenantId
public void setTenantId()
-
isTenantId
public boolean isTenantId()
-
isIdClass
public boolean isIdClass()
-
addDbMigrationInfo
public void addDbMigrationInfo(DbMigrationInfo info)
-
getDbMigrationInfos
public List<DbMigrationInfo> getDbMigrationInfos()
-
setElementProperty
public void setElementProperty()
Set when this property is part of a 'element bean' used with ElementCollection.
-
getJacksonField
public Object getJacksonField()
Returns the jackson annotated field, if jackson is present.
-
initMetaAnnotations
public void initMetaAnnotations(Set<Class<?>> metaAnnotationsFilter)
-
getMetaAnnotation
public <A extends Annotation> A getMetaAnnotation(Class<A> annotationType)
-
getMetaAnnotations
public <A extends Annotation> List<A> getMetaAnnotations(Class<A> annotationType)
-
getMetaAnnotationSize
public List<javax.validation.constraints.Size> getMetaAnnotationSize()
-
getMetaAnnotationFormula
public io.ebean.annotation.Formula getMetaAnnotationFormula(io.ebean.annotation.Platform platform)
-
getMetaAnnotationWhere
public io.ebean.annotation.Where getMetaAnnotationWhere(io.ebean.annotation.Platform platform)
-
-