org.eobjects.metamodel.schema
Class ImmutableColumn

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

public final class ImmutableColumn
extends AbstractColumn
implements Serializable

Immutable implementation of the Column interface. It is not intended to be instantiated on it's own. Rather, use the constructor in ImmutableSchema.

Author:
Kasper Sørensen
See Also:
ImmutableSchema, Serialized Form

Constructor Summary
protected ImmutableColumn(Column column, org.eobjects.metamodel.schema.ImmutableTable table)
           
  ImmutableColumn(Column column, Table table)
          Constructs an ImmutableColumn based on an existing column and a table.
  ImmutableColumn(String name, ColumnType type, Table table, int columnNumber, Integer columnSize, String nativeType, Boolean nullable, String remarks, boolean indexed, String quote, boolean primaryKey)
          Constructs a new ImmutableColumn.
 
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.
 
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

ImmutableColumn

public ImmutableColumn(String name,
                       ColumnType type,
                       Table table,
                       int columnNumber,
                       Integer columnSize,
                       String nativeType,
                       Boolean nullable,
                       String remarks,
                       boolean indexed,
                       String quote,
                       boolean primaryKey)
Constructs a new ImmutableColumn.

Parameters:
name - the name of the column
type - the type of the column
table - the table which the constructed column will pertain to
columnNumber - the column number of the column
columnSize - the size of the column
nativeType - the native type of the column
nullable - whether the column's values are nullable
remarks - the remarks of the column
indexed - whether the column is indexed or not
quote - the quote character(s) of the column
primaryKey - whether the column is a primary key or not

ImmutableColumn

public ImmutableColumn(Column column,
                       Table table)
Constructs an ImmutableColumn based on an existing column and a table.

Parameters:
column - the column to immitate
table - the table that the constructed column will pertain to

ImmutableColumn

protected ImmutableColumn(Column column,
                          org.eobjects.metamodel.schema.ImmutableTable table)
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.

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.

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.

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.

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.

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.

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.

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)

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

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).

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.


Copyright © 2007-2013. All Rights Reserved.