com.simba.dsi.dataengine.utilities
Class ColumnMetadata

java.lang.Object
  extended by com.simba.dsi.dataengine.utilities.ColumnMetadata
All Implemented Interfaces:
IColumn
Direct Known Subclasses:
MetadataColumn

public class ColumnMetadata
extends java.lang.Object
implements IColumn

A ColumnMetadata describes a column and the type of data found within.


Constructor Summary
ColumnMetadata(TypeMetadata typeMetadata)
          Constructor.
 
Method Summary
static ColumnMetadata copyOf(IColumn column)
          Creates a new ColumnMetadata initialized with the values of column.
 boolean equals(java.lang.Object obj)
          Indicates whether some other object is "equal to" this one.
 java.lang.String getCatalogName()
          Returns the name of the catalog from which the column was derived.
 long getColumnLength()
          Returns the length of a character or binary column, such as 100 for a VARCHAR(100) column.
 long getDisplaySize()
          Returns the display size for the column
 java.lang.String getLabel()
          Returns the column label or title.
 java.lang.String getName()
          Returns the column alias.
 Nullable getNullable()
          Returns information about the nullability of the column.
 java.lang.String getSchemaName()
          Returns the name of the schema from which the column was derived.
 Searchable getSearchable()
          Returns information about how the column can be used in a WHERE clause.
 java.lang.String getTableName()
          Returns the name of the derived table or database table from which the column originates.
 TypeMetadata getTypeMetadata()
          Returns the metadata regarding the column's data type.
 Updatable getUpdatable()
          Returns information about whether or not the column is writable.
 int hashCode()
          Return the hash code of this object.
 boolean isAutoUnique()
          Indicates whether the column is auto-incrementing.
 boolean isCaseSensitive()
          Indicates whether the column is considered case sensitive for collations and comparisons.
 boolean isDefinitelyWritable()
          Indicates whether the column is definitely writable.
 boolean isUnnamed()
          Indicates whether the column is considered "unnamed".
 void setAutoUnique(boolean isAutoUnique)
          Sets the column's auto-incrementing indicator.
 void setCaseSensitive(boolean isCaseSensitive)
          Sets the column's case sensitivity indicator.
 void setCatalogName(java.lang.String catalogName)
          Sets the name of the catalog the column derives from.
 void setColumnLength(long columnLength)
          Sets the column's length for character or binary types.
 void setLabel(java.lang.String label)
          Sets the column's label.
 void setName(java.lang.String name)
          Sets the column's name.
 void setNullable(Nullable nullable)
          Sets the column's nullability.
 void setSchemaName(java.lang.String schemaName)
          Sets the name of the schema that the column derives from.
 void setSearchable(Searchable searchable)
          Sets the column's searchability.
 void setTableName(java.lang.String tableName)
          Sets the name of the table the column is derived from.
 void setTypeMetadata(TypeMetadata typeMetadata)
          Sets the metadata related to the column's type.
 void setUpdatable(Updatable updatable)
          Sets the column's updatability.
 java.lang.String toString()
          Return a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ColumnMetadata

public ColumnMetadata(TypeMetadata typeMetadata)
               throws java.lang.NullPointerException
Constructor.

Sets the TypeMetadata to typeMetadata. The typeMetadata argument cannot be null or an exception will be thrown.

All other fields are set to the following defaults:

Parameters:
typeMetadata - The metadata related to the column's type. This cannot be null.
Throws:
java.lang.NullPointerException - If typeMetadata is null.
Method Detail

copyOf

public static ColumnMetadata copyOf(IColumn column)
Creates a new ColumnMetadata initialized with the values of column.

Parameters:
column - the IColumn metadata.
Returns:
a ColumnMetadata instance initialized with the values of column.

getCatalogName

public java.lang.String getCatalogName()
Returns the name of the catalog from which the column was derived. May return an empty string if not applicable.

The catalog name is an empty string by default.

Specified by:
getCatalogName in interface IColumn
Returns:
Catalog name.

getColumnLength

public long getColumnLength()
Returns the length of a character or binary column, such as 100 for a VARCHAR(100) column. The value returned by this method is ignored for datetime and interval data types, and has no real meaning for non-character/binary data types.

The length returned by this method must fit within an unsigned 32-bit integer.

The length is 0 by default.

Specified by:
getColumnLength in interface IColumn
Returns:
Column length.

getDisplaySize

public long getDisplaySize()
                    throws com.simba.support.exceptions.ErrorException
Returns the display size for the column

Specified by:
getDisplaySize in interface IColumn
Returns:
the display size.
Throws:
com.simba.support.exceptions.ErrorException - If the type of this column is not supported.

getLabel

public java.lang.String getLabel()
Returns the column label or title.

The label is an empty string by default.

Specified by:
getLabel in interface IColumn
Returns:
Column label or title.

getName

public java.lang.String getName()
Returns the column alias. If an alias is not applicable, returns the name of the column within its table. If null is returned, then the column is to be considered "unnamed".

The column alias or name is an empty string by default.

Specified by:
getName in interface IColumn
Returns:
Column alias or name, or null.

getNullable

public Nullable getNullable()
Returns information about the nullability of the column.

The nullability is NULLABLE_UNKNOWN by default.

Specified by:
getNullable in interface IColumn
Returns:
Nullable giving the column's nullability.
See Also:
Nullable

getSchemaName

public java.lang.String getSchemaName()
Returns the name of the schema from which the column was derived. May return an empty string if not applicable.

The schema name is an empty string by default.

Specified by:
getSchemaName in interface IColumn
Returns:
the schema name.

getSearchable

public Searchable getSearchable()
Returns information about how the column can be used in a WHERE clause.

The searchability is SEARCHABLE_ALL by default.

Specified by:
getSearchable in interface IColumn
Returns:
Searchable giving the column's searchability.
See Also:
Searchable

getTableName

public java.lang.String getTableName()
Returns the name of the derived table or database table from which the column originates. May return an empty string if not applicable.

The table name is an empty string by default.

Specified by:
getTableName in interface IColumn
Returns:
Table or derived table name.

getTypeMetadata

public TypeMetadata getTypeMetadata()
Returns the metadata regarding the column's data type.

Specified by:
getTypeMetadata in interface IColumn
Returns:
TypeMetadata describing the column's data type.
See Also:
TypeMetadata

getUpdatable

public Updatable getUpdatable()
Returns information about whether or not the column is writable.

The column's updatability is UPDATABLE_UNKNOWN by default.

Specified by:
getUpdatable in interface IColumn
Returns:
Updatable giving the column's updatability.
See Also:
Updatable

isAutoUnique

public boolean isAutoUnique()
Indicates whether the column is auto-incrementing.

The column metadata is set to not auto-incrementing by default.

Specified by:
isAutoUnique in interface IColumn
Returns:
Indication of whether or not the column is auto-incrementing.

isCaseSensitive

public boolean isCaseSensitive()
Indicates whether the column is considered case sensitive for collations and comparisons. The value returned by this method is ignored for non-character/wide character data types.

The column metadata is set to case insensitive by default.

Specified by:
isCaseSensitive in interface IColumn
Returns:
Indication of whether or not the column is case sensitive.

isDefinitelyWritable

public boolean isDefinitelyWritable()
Indicates whether the column is definitely writable.

Specified by:
isDefinitelyWritable in interface IColumn
Returns:
true if the column is definitely writable, false otherwise.

isUnnamed

public boolean isUnnamed()
Indicates whether the column is considered "unnamed".

Specified by:
isUnnamed in interface IColumn
Returns:
true if the column is "unnamed", false otherwise.

setAutoUnique

public void setAutoUnique(boolean isAutoUnique)
Sets the column's auto-incrementing indicator.

Parameters:
isAutoUnique -

setCaseSensitive

public void setCaseSensitive(boolean isCaseSensitive)
Sets the column's case sensitivity indicator.

Parameters:
isCaseSensitive -

setCatalogName

public void setCatalogName(java.lang.String catalogName)
Sets the name of the catalog the column derives from.

Parameters:
catalogName -

setColumnLength

public void setColumnLength(long columnLength)
                     throws NumericOverflowException
Sets the column's length for character or binary types.

This length must fit within the range of an unsigned 32-bit integer.

Parameters:
columnLength -
Throws:
NumericOverflowException - If the value is out of range.

setLabel

public void setLabel(java.lang.String label)
Sets the column's label.

Parameters:
label -

setName

public void setName(java.lang.String name)
Sets the column's name. Use null if it is "unnamed".

Parameters:
name -

setNullable

public void setNullable(Nullable nullable)
Sets the column's nullability.

Parameters:
nullable -

setSchemaName

public void setSchemaName(java.lang.String schemaName)
Sets the name of the schema that the column derives from.

Parameters:
schemaName -

setSearchable

public void setSearchable(Searchable searchable)
Sets the column's searchability.

Parameters:
searchable -

setTableName

public void setTableName(java.lang.String tableName)
Sets the name of the table the column is derived from.

Parameters:
tableName -

setTypeMetadata

public void setTypeMetadata(TypeMetadata typeMetadata)
                     throws java.lang.NullPointerException
Sets the metadata related to the column's type. Cannot be null.

Parameters:
typeMetadata -
Throws:
java.lang.NullPointerException - If typeMetadata is null.

setUpdatable

public void setUpdatable(Updatable updatable)
Sets the column's updatability.

Parameters:
updatable -

toString

public java.lang.String toString()
Return a string representation of this object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this object.

hashCode

public int hashCode()
Return the hash code of this object.

Overrides:
hashCode in class java.lang.Object
Returns:
the hash code.

equals

public boolean equals(java.lang.Object obj)
Indicates whether some other object is "equal to" this one.

The equality are check against all memebers.

Overrides:
equals in class java.lang.Object
Parameters:
obj - The object to check equality against.
Returns:
true if the given object is equal to this object, false other wise.


Copyright © 2006-2014 Simba Technologies Incorporated. All Rights Reserved.