Class ColumnEditorImpl

    • Field Detail

      • jdbcType

        private int jdbcType
      • nativeType

        private int nativeType
      • typeName

        private String typeName
      • typeExpression

        private String typeExpression
      • charsetName

        private String charsetName
      • tableCharsetName

        private String tableCharsetName
      • length

        private int length
      • position

        private int position
      • optional

        private boolean optional
      • autoIncremented

        private boolean autoIncremented
      • generated

        private boolean generated
      • defaultValueExpression

        private String defaultValueExpression
      • hasDefaultValue

        private boolean hasDefaultValue
      • comment

        private String comment
    • Constructor Detail

      • ColumnEditorImpl

        protected ColumnEditorImpl()
    • Method Detail

      • name

        public String name()
        Description copied from interface: ColumnEditor
        Get the name of the column.
        Specified by:
        name in interface ColumnEditor
        Returns:
        the column name; may be null if not set
      • typeName

        public String typeName()
        Description copied from interface: ColumnEditor
        Get the database-specific name of the column's data type.
        Specified by:
        typeName in interface ColumnEditor
        Returns:
        the name of the type; may be null if not set
      • typeExpression

        public String typeExpression()
        Description copied from interface: ColumnEditor
        Get the database-specific complete expression defining the column's data type, including dimensions, length, precision, character sets, constraints, etc.
        Specified by:
        typeExpression in interface ColumnEditor
        Returns:
        the complete type expression
      • nativeType

        public int nativeType()
        Description copied from interface: ColumnEditor
        Get the internal database-specific type identifier for this column.
        Specified by:
        nativeType in interface ColumnEditor
        Returns:
        a type constant for the specific database
      • charsetName

        public String charsetName()
        Description copied from interface: ColumnEditor
        Get the database-specific name of the character set used by this column.
        Specified by:
        charsetName in interface ColumnEditor
        Returns:
        the database-specific character set name, or null if the column's data type doesn't use character sets or no character set is specified
      • charsetNameOfTable

        public String charsetNameOfTable()
        Description copied from interface: ColumnEditor
        Get the database-specific name of the character set defined by this column's table, which is used if a character set is not explicitly set on this column.
        Specified by:
        charsetNameOfTable in interface ColumnEditor
        Returns:
        the database-specific character set name defined for this column's table, or null if not defined
      • length

        public int length()
        Description copied from interface: ColumnEditor
        Get the maximum length of this column's values. For numeric columns, this represents the precision.
        Specified by:
        length in interface ColumnEditor
        Returns:
        the length of the column
      • position

        public int position()
        Description copied from interface: ColumnEditor
        Get the position of the column in the table.
        Specified by:
        position in interface ColumnEditor
        Returns:
        the 1-based position
      • isOptional

        public boolean isOptional()
        Description copied from interface: ColumnEditor
        Determine whether this column is optional.
        Specified by:
        isOptional in interface ColumnEditor
        Returns:
        true if it is optional, or false otherwise
      • isAutoIncremented

        public boolean isAutoIncremented()
        Description copied from interface: ColumnEditor
        Determine whether this column's values are automatically incremented by the database.
        Specified by:
        isAutoIncremented in interface ColumnEditor
        Returns:
        true if the values are auto-incremented, or false otherwise
      • isGenerated

        public boolean isGenerated()
        Description copied from interface: ColumnEditor
        Determine whether this column's values are generated by the database.
        Specified by:
        isGenerated in interface ColumnEditor
        Returns:
        true if the values are generated, or false otherwise
      • defaultValueExpression

        public Optional<String> defaultValueExpression()
        Description copied from interface: ColumnEditor
        Get the database-specific complete expression defining the column's default value.
        Specified by:
        defaultValueExpression in interface ColumnEditor
        Returns:
        the complete type expression
      • hasDefaultValue

        public boolean hasDefaultValue()
        Description copied from interface: ColumnEditor
        Determine whether this column's has a default value set
        Specified by:
        hasDefaultValue in interface ColumnEditor
        Returns:
        true if the default value was provided, or false otherwise
      • comment

        public String comment()
        Description copied from interface: ColumnEditor
        Get the comment of the column.
        Specified by:
        comment in interface ColumnEditor
        Returns:
        the column comment; may be null if not set
      • name

        public ColumnEditorImpl name​(String name)
        Description copied from interface: ColumnEditor
        Set the name of the column.
        Specified by:
        name in interface ColumnEditor
        Parameters:
        name - the column name
        Returns:
        this editor so callers can chain methods together
      • enumValues

        public List<String> enumValues()
        Description copied from interface: ColumnEditor
        get the enumeration values for the column.
        Specified by:
        enumValues in interface ColumnEditor
        Returns:
        the list of enumeration values
      • type

        public ColumnEditorImpl type​(String typeName)
        Description copied from interface: ColumnEditor
        Set the database-specific name of the column's data type.
        Specified by:
        type in interface ColumnEditor
        Parameters:
        typeName - the column's type name
        Returns:
        this editor so callers can chain methods together
      • type

        public ColumnEditor type​(String typeName,
                                 String typeExpression)
        Description copied from interface: ColumnEditor
        Set the database-specific name of the column's data type. The expression includes the column's type name and also any dimensions, lengths, precisions, character sets, etc.
        Specified by:
        type in interface ColumnEditor
        Parameters:
        typeName - the column's type name
        typeExpression - the column's complete type expression
        Returns:
        this editor so callers can chain methods together
      • nativeType

        public ColumnEditorImpl nativeType​(int nativeType)
        Description copied from interface: ColumnEditor
        Set the native type for this column . This is database specific.
        Specified by:
        nativeType in interface ColumnEditor
        Returns:
        a type constant for the specific database
      • charsetName

        public ColumnEditor charsetName​(String charsetName)
        Description copied from interface: ColumnEditor
        Set the database-specific name of the character set used by this column.
        Specified by:
        charsetName in interface ColumnEditor
        Parameters:
        charsetName - the database-specific character set name; may be null
        Returns:
        this editor so callers can chain methods together
      • charsetNameOfTable

        public ColumnEditor charsetNameOfTable​(String charsetName)
        Description copied from interface: ColumnEditor
        Set the database-specific name of the character set defined by this column's table.
        Specified by:
        charsetNameOfTable in interface ColumnEditor
        Parameters:
        charsetName - the database-specific character set name; may be null
        Returns:
        this editor so callers can chain methods together
      • length

        public ColumnEditorImpl length​(int length)
        Description copied from interface: ColumnEditor
        Set the maximum length of this column's values. For numeric columns, this represents the precision.
        Specified by:
        length in interface ColumnEditor
        Parameters:
        length - the column's length
        Returns:
        this editor so callers can chain methods together
      • scale

        public ColumnEditorImpl scale​(Integer scale)
        Description copied from interface: ColumnEditor
        Set the scale of the column.
        Specified by:
        scale in interface ColumnEditor
        Parameters:
        scale - the scale or null to unset
        Returns:
        this editor so callers can chain methods together
      • optional

        public ColumnEditorImpl optional​(boolean optional)
        Description copied from interface: ColumnEditor
        Set whether the column's values are optional (e.g., can contain nulls).
        Specified by:
        optional in interface ColumnEditor
        Parameters:
        optional - true if the column's values are optional, or false otherwise
        Returns:
        this editor so callers can chain methods together
      • autoIncremented

        public ColumnEditorImpl autoIncremented​(boolean autoIncremented)
        Description copied from interface: ColumnEditor
        Set whether the column's values are automatically incremented.
        Specified by:
        autoIncremented in interface ColumnEditor
        Parameters:
        autoIncremented - true if the column's values are automatically incremented by the database, or false otherwise
        Returns:
        this editor so callers can chain methods together
      • generated

        public ColumnEditorImpl generated​(boolean generated)
        Description copied from interface: ColumnEditor
        Set whether the column's values are generated by the database.
        Specified by:
        generated in interface ColumnEditor
        Parameters:
        generated - true if the column's values are generated by the database, or false otherwise
        Returns:
        this editor so callers can chain methods together
      • position

        public ColumnEditorImpl position​(int position)
        Description copied from interface: ColumnEditor
        Set the position of the column within the table definition.
        Specified by:
        position in interface ColumnEditor
        Parameters:
        position - the new column position
        Returns:
        this editor so callers can chain methods together
      • defaultValueExpression

        public ColumnEditor defaultValueExpression​(String defaultValueExpression)
        Description copied from interface: ColumnEditor
        Set the default value expression of the column;
        Specified by:
        defaultValueExpression in interface ColumnEditor
        Parameters:
        defaultValueExpression - the default value expression
        Returns:
        this editor so callers can chain methods together
      • unsetDefaultValueExpression

        public ColumnEditor unsetDefaultValueExpression()
        Description copied from interface: ColumnEditor
        Unsets the default value expression of the column, reverting the editor to the state where {@link #defaultValueExpression(String))} has never been called
        Specified by:
        unsetDefaultValueExpression in interface ColumnEditor
        Returns:
        this editor so callers can chain methods together
      • enumValues

        public ColumnEditor enumValues​(List<String> enumValues)
        Description copied from interface: ColumnEditor
        Set the list of enumeration values.
        Specified by:
        enumValues in interface ColumnEditor
        Parameters:
        enumValues - the enumeration values
        Returns:
        this editor so callers can chain methods together
      • comment

        public ColumnEditor comment​(String comment)
        Description copied from interface: ColumnEditor
        Set the comment of the column
        Specified by:
        comment in interface ColumnEditor
        Parameters:
        comment - column comment
        Returns:
        this editor so callers can chain methods together
      • create

        public Column create()
        Description copied from interface: ColumnEditor
        Obtain an immutable column definition representing the current state of this editor. Typically, an editor is created and used to build a column, and then discarded. However, this editor with its current state can be reused after this method, since the resulting column definition no longer refers to any of the data used in this editor.
        Specified by:
        create in interface ColumnEditor
        Returns:
        the immutable column definition; never null