org.eobjects.metamodel.schema
Class MutableColumn

java.lang.Object
  extended by org.eobjects.metamodel.schema.AbstractColumn
      extended by org.eobjects.metamodel.schema.MutableColumn
All Implemented Interfaces:
Serializable, Comparable<Column>, Column, NamedStructure, HasName

public class MutableColumn
extends AbstractColumn
implements Serializable

Represents a column and it's metadata description. Columns reside within a Table and can be used as keys for relationships between tables.

See Also:
MutableTable, Relationship, Serialized Form

Constructor Summary
MutableColumn()
           
MutableColumn(String name)
           
MutableColumn(String name, ColumnType type)
           
MutableColumn(String name, ColumnType type, Table table, int columnNumber, Boolean nullable)
           
MutableColumn(String name, ColumnType type, Table table, int columnNumber, Integer columnSize, String nativeType, Boolean nullable, String remarks, boolean indexed, String quote)
           
 
Method Summary
 int getColumnNumber()
          Returns the column number or index.
 Integer getColumnSize()
          Gets the data type size of this column.
 String getName()
          Gets the name of this Column
 String getNativeType()
          Gets the native type of this column.
 String getQuote()
          Gets an optional quote string that is used to enclose the name of this structure.
 String getRemarks()
          Gets any remarks/comments to this column.
 Table getTable()
          Gets the table for which this column belong
 ColumnType getType()
          Gets the type of the column
 boolean isIndexed()
          Determines if this column is indexed.
 Boolean isNullable()
          Determines whether or not this column accepts null values.
 boolean isPrimaryKey()
          Determines if this column is (one of) the primary key(s) of its table.
 MutableColumn setColumnNumber(int columnNumber)
           
 MutableColumn setColumnSize(Integer columnSize)
           
 MutableColumn setIndexed(boolean indexed)
           
 MutableColumn setName(String name)
           
 MutableColumn setNativeType(String nativeType)
           
 MutableColumn setNullable(Boolean nullable)
           
 MutableColumn setPrimaryKey(boolean primaryKey)
           
 MutableColumn setQuote(String quoteString)
           
 MutableColumn setRemarks(String remarks)
           
 MutableColumn setTable(Table table)
           
 MutableColumn setType(ColumnType type)
           
 
Methods inherited from class org.eobjects.metamodel.schema.AbstractColumn
compareTo, equals, getQualifiedLabel, getQuotedName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

MutableColumn

public MutableColumn()

MutableColumn

public MutableColumn(String name)

MutableColumn

public MutableColumn(String name,
                     ColumnType type)

MutableColumn

public MutableColumn(String name,
                     ColumnType type,
                     Table table,
                     int columnNumber,
                     Boolean nullable)

MutableColumn

public MutableColumn(String name,
                     ColumnType type,
                     Table table,
                     int columnNumber,
                     Integer columnSize,
                     String nativeType,
                     Boolean nullable,
                     String remarks,
                     boolean indexed,
                     String quote)
Method Detail

getColumnNumber

public int getColumnNumber()
Description copied from interface: Column
Returns the column number or index. Note: This column number is 0-based whereas the JDBC is 1-based.

Specified by:
getColumnNumber in interface Column
Returns:
the number of this column.

setColumnNumber

public MutableColumn setColumnNumber(int columnNumber)

getName

public String getName()
Description copied from interface: Column
Gets the name of this Column

Specified by:
getName in interface Column
Specified by:
getName in interface NamedStructure
Specified by:
getName in interface HasName
Returns:
the name of this Column

setName

public MutableColumn setName(String name)

getType

public ColumnType getType()
Description copied from interface: Column
Gets the type of the column

Specified by:
getType in interface Column
Returns:
this column's type.

setType

public MutableColumn setType(ColumnType type)

getTable

public Table getTable()
Description copied from interface: Column
Gets the table for which this column belong

Specified by:
getTable in interface Column
Returns:
this column's table.

setTable

public MutableColumn setTable(Table table)

isNullable

public Boolean isNullable()
Description copied from interface: Column
Determines whether or not this column accepts null values.

Specified by:
isNullable in interface Column
Returns:
true if this column accepts null values, false if not and null if not known.

setNullable

public MutableColumn setNullable(Boolean nullable)

getRemarks

public String getRemarks()
Description copied from interface: Column
Gets any remarks/comments to this column.

Specified by:
getRemarks in interface Column
Returns:
any remarks/comments to this column.

setRemarks

public MutableColumn setRemarks(String remarks)

getColumnSize

public Integer getColumnSize()
Description copied from interface: Column
Gets the data type size of this column.

Specified by:
getColumnSize in interface Column
Returns:
the data type size of this column or null if the size is not determined or known.

setColumnSize

public MutableColumn setColumnSize(Integer columnSize)

getNativeType

public String getNativeType()
Description copied from interface: Column
Gets the native type of this column. A native type is the name of the data type as defined in the datastore.

Specified by:
getNativeType in interface Column
Returns:
the name of the native type.

setNativeType

public MutableColumn setNativeType(String nativeType)

isIndexed

public boolean isIndexed()
Description copied from interface: Column
Determines if this column is indexed.

Specified by:
isIndexed in interface Column
Returns:
true if this column is indexed or false if not (or not known)

setIndexed

public MutableColumn setIndexed(boolean indexed)

getQuote

public String getQuote()
Description copied from interface: NamedStructure
Gets an optional quote string that is used to enclose the name of this structure.

Specified by:
getQuote in interface NamedStructure
Returns:
A quote string used to enclose the name or null if none exists.

setQuote

public MutableColumn setQuote(String quoteString)

isPrimaryKey

public boolean isPrimaryKey()
Description copied from interface: Column
Determines if this column is (one of) the primary key(s) of its table.

Specified by:
isPrimaryKey in interface Column
Returns:
true if this column is a primary key, or false if not (or if this is not determinable).

setPrimaryKey

public MutableColumn setPrimaryKey(boolean primaryKey)


Copyright © 2007-2013. All Rights Reserved.