org.jboss.dna.common.jdbc.model.api
Interface Column

All Superinterfaces:
CoreMetaData, DatabaseNamedObject, Serializable
All Known Subinterfaces:
Attribute, ForeignKeyColumn, IndexColumn, KeyColumn, Parameter, PrimaryKeyColumn, TableColumn
All Known Implementing Classes:
AttributeBean, ColumnBean, ForeignKeyColumnBean, IndexColumnBean, KeyColumnBean, ParameterBean, PrimaryKeyColumnBean, TableColumnBean

public interface Column
extends DatabaseNamedObject

Provides all column specific metadata.

Author:
Sergiy Litsenko

Method Summary
 void addPrivilege(Privilege privilege)
          Adds table column priviledge
 void deletePrivilege(Privilege privilege)
          Deletes table column priviledge
 Privilege findPriviledgeByName(String priviledgeName)
          Searches priviledge by name
 Integer getCharOctetLength()
          For char types returns the maximum number of bytes in the column.
 String getDefaultValue()
          Gets default value (may be null)
 NullabilityType getNullabilityType()
          Gets column nullability
 Integer getOrdinalPosition()
          Returns index of column starting at 1 - if applicable.
 SchemaObject getOwner()
          Returns owner of ColumnMetaData such as Table, or Stored Procedure, UDT, PK, FK, Index, etc.
 Integer getPrecision()
          Gets precision if applicable otherwise 0.
 Set<Privilege> getPrivileges()
          Gets table column privileges.
 Integer getRadix()
          Gets radix if applicable
 Integer getSize()
          Gets column size.
 SqlType getSqlType()
          Gets SQL type from java.sql.Types
 String getTypeName()
          Data source dependent type name.
 void setCharOctetLength(Integer charOctetLength)
          For char types sets the maximum number of bytes in the column.
 void setDefaultValue(String defaultValue)
          Sets default value (may be null)
 void setNullabilityType(NullabilityType nullabilityType)
          Sets column nullability
 void setOrdinalPosition(Integer ordinalPosition)
          Sets index of column starting at 1 - if applicable.
 void setOwner(SchemaObject owner)
          Sets the owner of ColumnMetaData
 void setPrecision(Integer precision)
          Sets precision if applicable otherwise 0.
 void setRadix(Integer radix)
          Sets radix if applicable
 void setSize(Integer size)
          Sets column size.
 void setSqlType(SqlType sqlType)
          Sets SQL type from java.sql.Types
 void setTypeName(String typeName)
          Data source dependent type name.
 
Methods inherited from interface org.jboss.dna.common.jdbc.model.api.DatabaseNamedObject
addExtraProperty, deleteExtraProperty, getExtraProperties, getExtraProperty, getName, getRemarks, setName, setRemarks
 

Method Detail

getOwner

SchemaObject getOwner()
Returns owner of ColumnMetaData such as Table, or Stored Procedure, UDT, PK, FK, Index, etc. May return NULL

Returns:
owner of ColumnMetaData such as Table, or Stored Procedure, or UDT, PK, FK, Index, etc. May return NULL

setOwner

void setOwner(SchemaObject owner)
Sets the owner of ColumnMetaData

Parameters:
owner - the owner of ColumnMetaData

getNullabilityType

NullabilityType getNullabilityType()
Gets column nullability

Returns:
column nullability

setNullabilityType

void setNullabilityType(NullabilityType nullabilityType)
Sets column nullability

Parameters:
nullabilityType - the column nullability

getSqlType

SqlType getSqlType()
Gets SQL type from java.sql.Types

Returns:
SQL type from java.sql.Types

setSqlType

void setSqlType(SqlType sqlType)
Sets SQL type from java.sql.Types

Parameters:
sqlType - the SQL type from java.sql.Types

getTypeName

String getTypeName()
Data source dependent type name. For a UDT, the type name is fully qualified. For a REF, the type name is fully qualified and represents the target type of the reference type.

Returns:
data source dependent type name

setTypeName

void setTypeName(String typeName)
Data source dependent type name. For a UDT, the type name is fully qualified. For a REF, the type name is fully qualified and represents the target type of the reference type.

Parameters:
typeName - data source dependent type name

getSize

Integer getSize()
Gets column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is precision. For Stored procedure columns it is length in bytes of data

Returns:
column size

setSize

void setSize(Integer size)
Sets column size. For char or date types this is the maximum number of characters, for numeric or decimal types this is precision. For Stored procedure columns it is length in bytes of data

Parameters:
size - the column size

getPrecision

Integer getPrecision()
Gets precision if applicable otherwise 0. For table columns return the number of fractional digits; for stored procedure column - scale.

Returns:
precision if applicable otherwise 0

setPrecision

void setPrecision(Integer precision)
Sets precision if applicable otherwise 0. For table columns return the number of fractional digits; for stored procedure column - scale.

Parameters:
precision - the precision if applicable otherwise 0

getRadix

Integer getRadix()
Gets radix if applicable

Returns:
radix if applicable

setRadix

void setRadix(Integer radix)
Sets radix if applicable

Parameters:
radix - if applicable

getDefaultValue

String getDefaultValue()
Gets default value (may be null)

Returns:
default value (may be null)

setDefaultValue

void setDefaultValue(String defaultValue)
Sets default value (may be null)

Parameters:
defaultValue - the default value (may be null)

getOrdinalPosition

Integer getOrdinalPosition()
Returns index of column starting at 1 - if applicable. Otherwise returns -1.

Returns:
index of column starting at 1 - if applicable. Otherwise returns -1.

setOrdinalPosition

void setOrdinalPosition(Integer ordinalPosition)
Sets index of column starting at 1 - if applicable. Otherwise returns -1.

Parameters:
ordinalPosition - the index of column starting at 1 - if applicable. Otherwise returns -1.

getCharOctetLength

Integer getCharOctetLength()
For char types returns the maximum number of bytes in the column. Otherwise returns -1. May return null.

Returns:
For char types returns the maximum number of bytes in the column. Otherwise returns -1. May return null.

setCharOctetLength

void setCharOctetLength(Integer charOctetLength)
For char types sets the maximum number of bytes in the column. Otherwise -1.

Parameters:
charOctetLength - For char types sets the maximum number of bytes in the column. Otherwise -1.

getPrivileges

Set<Privilege> getPrivileges()
Gets table column privileges.

Returns:
set of table column privileges

addPrivilege

void addPrivilege(Privilege privilege)
Adds table column priviledge

Parameters:
privilege - the table column priviledge

deletePrivilege

void deletePrivilege(Privilege privilege)
Deletes table column priviledge

Parameters:
privilege - the table column priviledge

findPriviledgeByName

Privilege findPriviledgeByName(String priviledgeName)
Searches priviledge by name

Parameters:
priviledgeName - the priviledge name to search
Returns:
priviledge if found, otherwise return null


Copyright © 2008-Present JBoss a division of Red Hat. All Rights Reserved.