Class Column

    • Field Detail

      • generatorPatternCache

        public java.lang.String generatorPatternCache
    • Constructor Detail

      • Column

        public Column​(AbstractTable table,
                      java.lang.String name)
        Public constructor. By default set as integer data type.
        Parameters:
        table - it belongs to
        name - of the column
      • Column

        public Column​(AbstractTable table,
                      java.lang.String name,
                      DataType dataType)
        Public constructor
        Parameters:
        table - it belongs to
        name - of the column
        dataType - to be used.
    • Method Detail

      • getSymbolicIcon

        public java.lang.String getSymbolicIcon()
        Specified by:
        getSymbolicIcon in class AbstractUnit
        Returns:
        an icon for the tree
      • getIndexingIcon

        public java.lang.String getIndexingIcon()
        Specified by:
        getIndexingIcon in interface Attribute
        Returns:
        an icon for the index ( if exists )
      • setDataType

        public void setDataType​(DataType dataType)
        Set the column data type definition. The length and decimal are set throgh separate methods
        Parameters:
        dataType - to use
      • getLengthOrDefo

        public int getLengthOrDefo()
      • getDecimalOrDefo

        public int getDecimalOrDefo()
      • hasLength

        public boolean hasLength()
        Returns:
        true if the Attribute has set the length
      • hasDecimal

        public boolean hasDecimal()
        Returns:
        true if the Attribute has a set the decimal
      • getLength

        public int getLength()
        Returns:
        data type length
      • setLength

        public void setLength​(int length)
        Set data type current length
        Parameters:
        length - of the column
      • getDecimal

        public int getDecimal()
        Returns:
        data type decimal
      • setDecimal

        public void setDecimal​(int decimal)
        Set data type decimal precision
        Parameters:
        decimal - of the column
      • getDataType

        public DataType getDataType()
        Specified by:
        getDataType in interface Attribute
        Returns:
        the column data type definition. The current length, precision, etc are stored in the Column
      • isUsingSameDataType

        public boolean isUsingSameDataType​(Column other)
      • getEnumeration

        public java.lang.String getEnumeration()
        Returns:
        the enumeration values
      • setEnumeration

        public void setEnumeration​(java.lang.String enumeration)
        Set enumeration values
        Parameters:
        enumeration - as list of comma separated text
      • getTypeOptions

        public java.lang.String getTypeOptions()
        Returns:
        The string to be added after the data type
      • setTypeOptions

        public void setTypeOptions​(java.lang.String typeOptions)
        Set the string to be added after the data type
        Parameters:
        typeOptions - as string
      • getOptions

        public java.lang.String getOptions()
        Returns:
        string which will be added on the end of the column definition
      • setOptions

        public void setOptions​(java.lang.String options)
        Set the parameters to add after the column definition
        Parameters:
        options - as string
      • isUnsigned

        public boolean isUnsigned()
        Returns:
        true if the column is unsigned
      • setUnsigned

        public void setUnsigned​(boolean unsigned)
        Mark the column as unsigned
        Parameters:
        unsigned - - values can be only above 0
      • isIdentity

        public boolean isIdentity()
        Returns:
        true if the column is autoincrement
      • setIdentity

        public void setIdentity​(boolean identity)
        Mark column as autoincrement
        Parameters:
        identity - true if autoincrement
      • setDefaultValue

        public void setDefaultValue​(java.lang.String defaultValue)
        Set the column default value
        Parameters:
        defaultValue - to use on insert if nothing is specified
      • hasDefaultValue

        public boolean hasDefaultValue()
        Returns:
        true if the column has set a default value
      • getDefaultValue

        public java.lang.String getDefaultValue()
        Returns:
        the column default value
      • areDefaultValuesCompatible

        public boolean areDefaultValuesCompatible​(Column target)
        Checks if the default values are similar
        Parameters:
        target - column
        Returns:
        true if the default values are pretty the same. Differences can be in values quotation
      • cloneFromColumn

        public void cloneFromColumn​(Column other)
        Clone the definition from the given column
        Parameters:
        other - to clone
      • setTicked

        public void setTicked​(boolean ticked)
        Not used with column
        Specified by:
        setTicked in interface Attribute
        Parameters:
        ticked - ommited
      • isTicked

        public boolean isTicked()
        Specified by:
        isTicked in interface Attribute
      • setMarker

        public void setMarker​(int marker)
      • hasMarker

        public boolean hasMarker​(int marker)
        Specified by:
        hasMarker in interface Attribute
      • resetMarkers

        public void resetMarkers()
      • setMandatory

        public void setMandatory​(boolean mandatory)
      • getTypeString

        public java.lang.String getTypeString()
        Specified by:
        getTypeString in interface Attribute
      • setToDoFlag

        public void setToDoFlag​(short toDo)
      • getGeneratorPattern

        public java.lang.String getGeneratorPattern()
        Get the random data generator pattern
        Returns:
        the pattern
      • setGeneratorPatternClearCache

        public void setGeneratorPatternClearCache​(java.lang.String generatorPattern)
        Set the random data generator pattern and clear the pattern cache.
        Parameters:
        generatorPattern - to set
      • setGeneratorPattern

        public boolean setGeneratorPattern​(java.lang.String generatorPattern)
        Set the random data generator pattern
        Parameters:
        generatorPattern - is the reverse reg exp or pattern for random number, values from file, etc.
        Returns:
        if true if set
      • getGeneratorNullsPercentage

        public short getGeneratorNullsPercentage()
        Get the percentage of the null values for the random data generator. Omitted if the column is mandatory
        Returns:
        percentage between 0 and 100
      • hasGeneratorNullsPercentage

        public boolean hasGeneratorNullsPercentage()
      • setGeneratorNullsPercentage

        public void setGeneratorNullsPercentage​(short nulls)
        Set the percentage of the null values for the random data generator. Omitted if the column is mandatory
        Parameters:
        nulls - as percentage between 0 and 100
      • isUnique

        public boolean isUnique()
        True if the column is unique. This is deduced from the indexes information
        Returns:
        true if the column is unique
      • getGeneratorSeed

        public int getGeneratorSeed()
      • setGeneratorSeed

        public void setGeneratorSeed​(int generatorSeed)
      • guessGeneratorPattern

        public java.lang.String guessGeneratorPattern()
        Return the best fitting random data generator pattern.
        Returns:
        pattern string, can be reverse reg exp, random number pattern, etc.
      • hasAssociatedSequence

        public boolean hasAssociatedSequence()
      • setAssociatedSequence

        public void setAssociatedSequence​(Sequence sequence)
      • getNameWithPath

        public java.lang.String getNameWithPath()
      • getParentColumn

        public Column getParentColumn()
      • hasChildrenColumns

        public boolean hasChildrenColumns()
      • getCreateChildrenColumns

        public Folder<Column> getCreateChildrenColumns()
      • createChildColumn

        public Column createChildColumn​(java.lang.String name,
                                        DataType dataType)
      • getSimilarMapColumnFromFolder

        public static Column getSimilarMapColumnFromFolder​(Folder<? extends Column> columns,
                                                           java.lang.String name)
      • setDefinition

        public void setDefinition​(java.lang.String definition)
      • getDefinition

        public java.lang.String getDefinition()
      • getRdbms

        public java.lang.String getRdbms()
        Specified by:
        getRdbms in interface DbUnit