org.eclipse.datatools.sqltools.sql.reference.internal
Class Column

java.lang.Object
  extended by org.eclipse.datatools.sqltools.sql.reference.DBObject
      extended by org.eclipse.datatools.sqltools.sql.reference.internal.Column
All Implemented Interfaces:
IColumn

public class Column
extends DBObject
implements IColumn

Author:
Li Huang

Field Summary
 
Fields inherited from class org.eclipse.datatools.sqltools.sql.reference.DBObject
COLUMN, DATABASE, DATATYPE, EVENT, FUNCTION, GLOBAL_TEMPORARY_TABLE, LOCAL_TEMPORARY_TABLE, STORED_PROCEDURE, SYSTABLE, SYSTEM_FUNCTION, SYSTEM_STORED_PROCEDURE, SYSVIEW, TABLE, TABLE_ALIAS, TRIGGER, VIEW
 
Constructor Summary
Column(java.lang.String name, java.lang.String owner, int type)
           
Column(java.lang.String ownerTable, java.lang.String name, java.lang.String typeName, int width, int scale, boolean nulls, boolean pkey, java.lang.String userTypeName, java.lang.String remarks, java.lang.String defaultValue)
           
 
Method Summary
 java.lang.String getDefaultValue()
          Returns the default value or null if none.
 java.lang.String getName()
          Returns the column name.
 java.lang.String getOwnerTable()
          Return the owner table name.
 java.lang.String getRemarks()
          Returns the explanatory remarks set on the column or null if none
 int getScale()
          Return the scale of the column.
 ITable getTable()
          Return the owner table.
 java.lang.String getTypeName()
          Returns the string represenation of the columns dataType.
 java.lang.String getUserType()
          Return the user type.
 int getWidth()
          Returns the width of the column.
 boolean isForeignKey()
          Returns true if this IColumn is part of a foreign key constraint.
 boolean isNullable()
          Returns true if this IColumn is nullable.
 boolean isPrimaryKey()
          Returns true if this IColumn is part of a primary key constraint.
 boolean isUnique()
          Returns true if this IColumn is part of a unique constraint.
 void setTable(ITable table)
          Set the owner table.
 
Methods inherited from class org.eclipse.datatools.sqltools.sql.reference.DBObject
getOwner, getType, setName, setOwner, setType
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Column

public Column(java.lang.String name,
              java.lang.String owner,
              int type)

Column

public Column(java.lang.String ownerTable,
              java.lang.String name,
              java.lang.String typeName,
              int width,
              int scale,
              boolean nulls,
              boolean pkey,
              java.lang.String userTypeName,
              java.lang.String remarks,
              java.lang.String defaultValue)
Method Detail

getName

public java.lang.String getName()
Description copied from interface: IColumn
Returns the column name.

Specified by:
getName in interface IColumn
Overrides:
getName in class DBObject
Returns:

getDefaultValue

public java.lang.String getDefaultValue()
Description copied from interface: IColumn
Returns the default value or null if none.

Specified by:
getDefaultValue in interface IColumn
Returns:
String

getWidth

public int getWidth()
Description copied from interface: IColumn
Returns the width of the column. This depends on the data type.

Specified by:
getWidth in interface IColumn
Returns:
int

getScale

public int getScale()
Description copied from interface: IColumn
Return the scale of the column. The number of digits after the decimal point for numeric data type columns, and zero for all other data types. This despends on the data type.

Specified by:
getScale in interface IColumn
Returns:
int

getTypeName

public java.lang.String getTypeName()
Description copied from interface: IColumn
Returns the string represenation of the columns dataType.

Specified by:
getTypeName in interface IColumn
Returns:
String

isForeignKey

public boolean isForeignKey()
Description copied from interface: IColumn
Returns true if this IColumn is part of a foreign key constraint.

Specified by:
isForeignKey in interface IColumn
Returns:
boolean

isNullable

public boolean isNullable()
Description copied from interface: IColumn
Returns true if this IColumn is nullable.

Specified by:
isNullable in interface IColumn
Returns:
boolean

isPrimaryKey

public boolean isPrimaryKey()
Description copied from interface: IColumn
Returns true if this IColumn is part of a primary key constraint.

Specified by:
isPrimaryKey in interface IColumn
Returns:
boolean

isUnique

public boolean isUnique()
Description copied from interface: IColumn
Returns true if this IColumn is part of a unique constraint.

Specified by:
isUnique in interface IColumn
Returns:
boolean

getRemarks

public java.lang.String getRemarks()
Description copied from interface: IColumn
Returns the explanatory remarks set on the column or null if none

Specified by:
getRemarks in interface IColumn
Returns:
String

getUserType

public java.lang.String getUserType()
Description copied from interface: IColumn
Return the user type. If the column is defined on a user-defined data type, the data type is held here.

Specified by:
getUserType in interface IColumn
Returns:
String

getOwnerTable

public java.lang.String getOwnerTable()
Description copied from interface: IColumn
Return the owner table name.

Specified by:
getOwnerTable in interface IColumn
Returns:
String

getTable

public ITable getTable()
Description copied from interface: IColumn
Return the owner table.

Specified by:
getTable in interface IColumn
Returns:
table

setTable

public void setTable(ITable table)
Description copied from interface: IColumn
Set the owner table.

Specified by:
setTable in interface IColumn