Interface DBFieldCapability.DBColumn

  • All Superinterfaces:
    PropertiesEditingConfigurable
    Enclosing interface:
    DBFieldCapability

    public static interface DBFieldCapability.DBColumn
    extends PropertiesEditingConfigurable
    Represents a single database column. This object can be used for obtaining more information about DB columns as well as for changing them (renaming column, resizing, etc.). Use the main schema DDL lock for setters.
    • Method Detail

      • getColumnName

        java.lang.String getColumnName()
        Get the name of the column.
        Returns:
        Value of property columnName.
      • setColumnName

        void setColumnName​(java.lang.String columnName,
                           com.im.commons.progress.DFEnvironmentRW env)
        Set the new name of the column.
        Parameters:
        columnName - New value of property columnName.
      • getScale

        int getScale()
        Get the scale of the column. Only appropriate for some column types. Will have the value of zero where not appropriate
        Returns:
        Value of property scale.
      • setScale

        void setScale​(int scale,
                      com.im.commons.progress.DFEnvironmentRW env)
        Set the scale of the column. Only appropriate for some column types. Default is zero.
        Parameters:
        scale - New value of property scale.
        env - The environment with feedback and proper lock
      • getLength

        int getLength()
        Get the length of the column. Only appropriate for some column types.
        Returns:
        Value of property length.
      • setLength

        void setLength​(int length,
                       com.im.commons.progress.DFEnvironmentRW env)
        Set the length of the column.
        Parameters:
        length - New value of property length.
        env - The environment with feedback and proper lock
      • isRequired

        boolean isRequired()
        NULL (false) or NOT NULL (true).
        Returns:
        Value of property required.
      • isOracleTextIndex

        java.lang.Boolean isOracleTextIndex()
        Returns:
        true if OracleText index for this column is present.
      • getDefaultValue

        java.lang.String getDefaultValue()
        Getter for property defaultValue. Can be null.
        Returns:
        Value of property defaultValue.
      • getJdbcType

        int getJdbcType()
        Get the jdbc type of the column, as defined in Types.
        Returns:
        Value of property jdbcType.
      • getNativeType

        java.lang.String getNativeType()
        Native database column type (e.g. VARCHAR2, NUMBER)
        Returns:
        The column type
      • getColumnType

        com.im.commons.db.ddl.DBDatabaseInfo.ColumnSQLType getColumnType()
        One of the ColumnType enum values. May not be defined if not understood by DIF.
        Returns:
        The the ColumnType enum value
      • columnDefinition

        java.lang.String columnDefinition()
        The full column definition e.g VARCHAR2(255) or NUMBER(10.1).

        TODO P2 - this method is going to be renamed to follow bean pattern style.

      • getField

        DFField getField()
        Get the field the column belongs to.
        Returns:
        Field that is owner of the column
      • getResizingSupported

        com.im.commons.db.ddl.DBDatabaseInfo.ResizingSupported getResizingSupported()
        Can the column be resized and rescaled.
        Returns:
        One of the values of the ResizingSupported enum.
      • addPropertyChangeListener

        void addPropertyChangeListener​(java.beans.PropertyChangeListener listener)
      • removePropertyChangeListener

        void removePropertyChangeListener​(java.beans.PropertyChangeListener listener)
      • canDrop

        boolean canDrop()
        Can column be dropped?
        Returns:
        true, if the DB column can be dropped. Some columns are fixed (e.g. JChem columns) and cannot be removed even though the field is deleted.
      • handleUpdateColInfo

        void handleUpdateColInfo​(com.im.commons.db.ddl.DBColInfo old,
                                 com.im.commons.db.ddl.DBColInfo nue)
      • isColumnValid

        boolean isColumnValid()
        Gets the status of the underlying database column.
        Returns:
        true if the underlying database column exists and can be used, false otherwise.
        Since:
        6.0
      • isColumnInitialized

        boolean isColumnInitialized()
        Gets the initialization status.
        Returns:
        true if this DBColumn instance has been properly initialized, false otherwise.