Class DeployBeanProperty

java.lang.Object
io.ebeaninternal.server.deploy.meta.DeployBeanProperty
All Implemented Interfaces:
DeployProperty
Direct Known Subclasses:
DeployBeanPropertyAssoc

public class DeployBeanProperty extends Object implements DeployProperty
Description of a property of a bean. Includes its deployment information such as database column mapping information.
  • Constructor Details

    • DeployBeanProperty

      public DeployBeanProperty(DeployBeanDescriptor<?> desc, Class<?> propertyType, io.ebean.core.type.ScalarType<?> scalarType, io.ebean.config.ScalarTypeConverter<?,?> typeConverter)
    • DeployBeanProperty

      public DeployBeanProperty(DeployBeanDescriptor<?> desc, Class<?> propertyType, Type genericType)
  • Method Details

    • getSortOverride

      public int getSortOverride()
    • getDesc

      public DeployBeanDescriptor<?> getDesc()
    • ownerType

      public Class<?> ownerType()
      Description copied from interface: DeployProperty
      Returns the owner class of this property.
      Specified by:
      ownerType in interface DeployProperty
    • 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)
    • mutationDetection

      public io.ebean.annotation.MutationDetection mutationDetection()
      Description copied from interface: DeployProperty
      Returns the mutation detection setting of this property.
      Specified by:
      mutationDetection in interface DeployProperty
    • setMutationDetection

      public void setMutationDetection(io.ebean.annotation.MutationDetection dirtyDetection)
      Description copied from interface: DeployProperty
      Sets the mutation detection setting of this property.
      Specified by:
      setMutationDetection in interface DeployProperty
    • 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 io.ebean.core.type.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(io.ebean.core.type.ScalarType<?> scalarType)
    • getPropertyIndex

      public int getPropertyIndex()
    • setPropertyIndex

      public void setPropertyIndex(int propertyIndex)
    • getGetter

      public io.ebeaninternal.server.properties.BeanPropertyGetter getGetter()
    • getSetter

      public io.ebeaninternal.server.properties.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(io.ebeaninternal.server.properties.BeanPropertyGetter getter)
      Set the getter used to read the property value from a bean.
    • setSetter

      public void setSetter(io.ebeaninternal.server.properties.BeanPropertySetter setter)
      Set the setter used to set the property value to a bean.
    • name

      public String name()
      Description copied from interface: DeployProperty
      Return the name of the property.
      Specified by:
      name in interface DeployProperty
    • setName

      public void setName(String name)
      Set the name of the property.
    • getField

      public Field getField()
      Return the bean Field associated with this property.
    • setField

      public void setField(Field field)
      Set the bean Field associated with this property.
    • isNaturalKey

      public boolean isNaturalKey()
    • getGeneratedProperty

      public io.ebeaninternal.server.deploy.generatedproperty.GeneratedProperty getGeneratedProperty()
      Return the GeneratedValue. Used to generate update timestamp etc.
    • setGeneratedProperty

      public void setGeneratedProperty(io.ebeaninternal.server.deploy.generatedproperty.GeneratedProperty generatedValue)
      Set the GeneratedValue. Used to generate update timestamp etc.
    • isNullable

      public boolean isNullable()
      Description copied from interface: DeployProperty
      Return true if this property is not mandatory.
      Specified by:
      isNullable in interface DeployProperty
    • 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(jakarta.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.
    • getFormula2Expression

      public String getFormula2Expression()
      Return the raw logical expression set by @Formula2.
    • setFormula2Expression

      public void setFormula2Expression(String formula2Expression)
      Set the raw logical expression for a @Formula2 property.
    • 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 io.ebean.config.dbplatform.DbEncryptFunction getDbEncryptFunction()
    • setDbEncryptFunction

      public void setDbEncryptFunction(io.ebean.config.dbplatform.DbEncryptFunction dbEncryptFunction, io.ebean.config.dbplatform.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.
    • propertyType

      public Class<?> propertyType()
      Description copied from interface: DeployProperty
      Return the property type.
      Specified by:
      propertyType in interface DeployProperty
    • genericType

      public Type genericType()
      Description copied from interface: DeployProperty
      Return the generic type for this property.
      Specified by:
      genericType in interface DeployProperty
    • 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.
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • isExcludedFromHistory

      public boolean isExcludedFromHistory()
    • setExcludedFromHistory

      public void setExcludedFromHistory()
    • 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()
    • 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.
    • initMetaAnnotations

      public void initMetaAnnotations(Set<Class<?>> metaAnnotationsFilter)
    • getMetaAnnotation

      public <A extends Annotation> A getMetaAnnotation(Class<A> annotationType)
    • metaAnnotations

      public <A extends Annotation> List<A> metaAnnotations(Class<A> annotationType)
      Description copied from interface: DeployProperty
      Returns the annotations on this property.
      Specified by:
      metaAnnotations in interface DeployProperty
    • getMetaAnnotationFormula

      public io.ebean.annotation.Formula getMetaAnnotationFormula(io.ebean.annotation.Platform platform)
    • getMetaAnnotationFormula2

      public io.ebean.annotation.Formula2 getMetaAnnotationFormula2(io.ebean.annotation.Platform platform)
    • getMetaAnnotationWhere

      public io.ebean.annotation.Where getMetaAnnotationWhere(io.ebean.annotation.Platform platform)
    • bindMaxLength

      public @Nullable BindMaxLength bindMaxLength()