org.jboss.dna.common.jdbc.model.spi
Class ColumnBean

java.lang.Object
  extended by org.jboss.dna.common.jdbc.model.spi.CoreMetaDataBean
      extended by org.jboss.dna.common.jdbc.model.spi.DatabaseNamedObjectBean
          extended by org.jboss.dna.common.jdbc.model.spi.ColumnBean
All Implemented Interfaces:
Serializable, Column, CoreMetaData, DatabaseNamedObject
Direct Known Subclasses:
AttributeBean, ParameterBean, TableColumnBean

public class ColumnBean
extends DatabaseNamedObjectBean
implements Column

Provides all column specific metadata.

Author:
Sergiy Litsenko
See Also:
Serialized Form

Constructor Summary
ColumnBean()
          Default constructor
 
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 class org.jboss.dna.common.jdbc.model.spi.DatabaseNamedObjectBean
addExtraProperty, deleteExtraProperty, getExtraProperties, getExtraProperty, getName, getRemarks, setName, setRemarks
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.jboss.dna.common.jdbc.model.api.DatabaseNamedObject
addExtraProperty, deleteExtraProperty, getExtraProperties, getExtraProperty, getName, getRemarks, setName, setRemarks
 

Constructor Detail

ColumnBean

public ColumnBean()
Default constructor

Method Detail

getOwner

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

Specified by:
getOwner in interface Column
Returns:
owner of ColumnMetaData such as Table, or Stored Procedure, or UDT, PK, FK, Index, etc. May return NULL

setOwner

public void setOwner(SchemaObject owner)
Sets the owner of ColumnMetaData

Specified by:
setOwner in interface Column
Parameters:
owner - the owner of ColumnMetaData

getNullabilityType

public NullabilityType getNullabilityType()
Gets column nullability

Specified by:
getNullabilityType in interface Column
Returns:
column nullability

setNullabilityType

public void setNullabilityType(NullabilityType nullabilityType)
Sets column nullability

Specified by:
setNullabilityType in interface Column
Parameters:
nullabilityType - the column nullability

getSqlType

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

Specified by:
getSqlType in interface Column
Returns:
SQL type from java.sql.Types

setSqlType

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

Specified by:
setSqlType in interface Column
Parameters:
sqlType - the SQL type from java.sql.Types

getTypeName

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

Specified by:
getTypeName in interface Column
Returns:
data source dependent type name

setTypeName

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

Specified by:
setTypeName in interface Column
Parameters:
typeName - data source dependent type name

getSize

public 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

Specified by:
getSize in interface Column
Returns:
column size

setSize

public 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

Specified by:
setSize in interface Column
Parameters:
size - the column size

getPrecision

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

Specified by:
getPrecision in interface Column
Returns:
precision if applicable otherwise 0

setPrecision

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

Specified by:
setPrecision in interface Column
Parameters:
precision - the precision if applicable otherwise 0

getRadix

public Integer getRadix()
Gets radix if applicable

Specified by:
getRadix in interface Column
Returns:
radix if applicable

setRadix

public void setRadix(Integer radix)
Sets radix if applicable

Specified by:
setRadix in interface Column
Parameters:
radix - if applicable

getDefaultValue

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

Specified by:
getDefaultValue in interface Column
Returns:
default value (may be null)

setDefaultValue

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

Specified by:
setDefaultValue in interface Column
Parameters:
defaultValue - the default value (may be null)

getOrdinalPosition

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

Specified by:
getOrdinalPosition in interface Column
Returns:
index of column starting at 1 - if applicable. Otherwise returns -1.

setOrdinalPosition

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

Specified by:
setOrdinalPosition in interface Column
Parameters:
ordinalPosition - the index of column starting at 1 - if applicable. Otherwise returns -1.

getCharOctetLength

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

Specified by:
getCharOctetLength in interface Column
Returns:
For char types returns the maximum number of bytes in the column. Otherwise returns -1.

setCharOctetLength

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

Specified by:
setCharOctetLength in interface Column
Parameters:
charOctetLength - For char types sets the maximum number of bytes in the column. Otherwise -1.

getPrivileges

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

Specified by:
getPrivileges in interface Column
Returns:
set of table column privileges

addPrivilege

public void addPrivilege(Privilege privilege)
Adds table column priviledge

Specified by:
addPrivilege in interface Column
Parameters:
privilege - the table column priviledge

deletePrivilege

public void deletePrivilege(Privilege privilege)
Deletes table column priviledge

Specified by:
deletePrivilege in interface Column
Parameters:
privilege - the table column priviledge

findPriviledgeByName

public Privilege findPriviledgeByName(String priviledgeName)
Searches priviledge by name

Specified by:
findPriviledgeByName in interface Column
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.