org.datanucleus.store.rdbms.table
Interface Column

All Superinterfaces:
org.datanucleus.store.mapped.DatastoreField
All Known Implementing Classes:
ColumnImpl

public interface Column
extends org.datanucleus.store.mapped.DatastoreField

Interface for a column in an RDBMS datastore.


Field Summary
static int WRAPPER_FUNCTION_INSERT
          wrapper function insert
static int WRAPPER_FUNCTION_SELECT
          wrapper function select
static int WRAPPER_FUNCTION_UPDATE
          wrapper function update
 
Method Summary
 void checkDecimal()
          Checks the column definition as a decimal.
 void checkInteger()
          Checks the column definition as an integer.
 void checkPrimitive()
          Checks the column definition as a primitive.
 void checkString()
          Checks the column definition as a string.
 java.lang.String getConstraints()
           
 int getJdbcType()
          Accessor for the JDBC type being used for this Column
 java.lang.String getSQLDefinition()
          Accessor for the SQL definition of this column.
 SQLTypeInfo getTypeInfo()
          Accessor for the type info for this column.
 java.lang.String getWrapperFunction(int wrapperMode)
          Gets the wrapper for parameters.
 void initializeColumnInfoFromDatastore(RDBMSColumnInfo ci)
          Initialize the default column value and auto increment
 boolean isUnlimitedLength()
          Convenience method to check if the length is required to be unlimited (BLOB/CLOB).
 Column setConstraints(java.lang.String constraints)
          Mutator for the constraints of the column.
 Column setTypeInfo(SQLTypeInfo typeInfo)
          Mutator for the type information of the column.
 void setWrapperFunction(java.lang.String wrapperFunction, int wrapperMode)
          Sets a function to wrap the column.
 void validate(RDBMSColumnInfo ci)
          Method to validate the contents of the column.
 
Methods inherited from interface org.datanucleus.store.mapped.DatastoreField
applySelectFunction, copyConfigurationTo, getColumnMetaData, getDatastoreContainerObject, getDatastoreMapping, getDefaultValue, getIdentifier, getJavaTypeMapping, getMemberMetaData, getStoredJavaType, getStoreManager, isDefaultable, isIdentity, isNullable, isPrimaryKey, isUnique, setAsPrimaryKey, setColumnMetaData, setDatastoreMapping, setDefaultable, setDefaultValue, setIdentifier, setIdentity, setNullable, setUnique
 

Field Detail

WRAPPER_FUNCTION_SELECT

static final int WRAPPER_FUNCTION_SELECT
wrapper function select

See Also:
Constant Field Values

WRAPPER_FUNCTION_INSERT

static final int WRAPPER_FUNCTION_INSERT
wrapper function insert

See Also:
Constant Field Values

WRAPPER_FUNCTION_UPDATE

static final int WRAPPER_FUNCTION_UPDATE
wrapper function update

See Also:
Constant Field Values
Method Detail

isUnlimitedLength

boolean isUnlimitedLength()
Convenience method to check if the length is required to be unlimited (BLOB/CLOB).

Returns:
Whether unlimited length required.

setTypeInfo

Column setTypeInfo(SQLTypeInfo typeInfo)
Mutator for the type information of the column.

Parameters:
typeInfo - The type info
Returns:
The column with the updated info

getTypeInfo

SQLTypeInfo getTypeInfo()
Accessor for the type info for this column.

Returns:
The type info

getJdbcType

int getJdbcType()
Accessor for the JDBC type being used for this Column

Returns:
The JDBC data type

getSQLDefinition

java.lang.String getSQLDefinition()
Accessor for the SQL definition of this column.

Returns:
The SQL definition of the column

initializeColumnInfoFromDatastore

void initializeColumnInfoFromDatastore(RDBMSColumnInfo ci)
Initialize the default column value and auto increment

Parameters:
ci - The column information

validate

void validate(RDBMSColumnInfo ci)
Method to validate the contents of the column. This method can throw IncompatibleDataTypeException, WrongScaleException, WrongPrecisionException, IsNullableException if the data in the column is not compatible with the supplied ColumnInfo.

Parameters:
ci - The column information taken from the database

setConstraints

Column setConstraints(java.lang.String constraints)
Mutator for the constraints of the column.

Parameters:
constraints - The constraints
Returns:
The column with the updated info

getConstraints

java.lang.String getConstraints()
Returns:
Returns the constraints.

checkPrimitive

void checkPrimitive()
                    throws org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
Checks the column definition as a primitive.

Throws:
org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException

checkInteger

void checkInteger()
                  throws org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
Checks the column definition as an integer.

Throws:
org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException

checkDecimal

void checkDecimal()
                  throws org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
Checks the column definition as a decimal.

Throws:
org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException

checkString

void checkString()
                 throws org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
Checks the column definition as a string.

Throws:
org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException

setWrapperFunction

void setWrapperFunction(java.lang.String wrapperFunction,
                        int wrapperMode)
Sets a function to wrap the column. The wrapper function String must use "?" to be replaced later by the column name. For example
SQRT(?) generates: SQRT(COLUMN)

Parameters:
wrapperFunction - The wrapperFunction to set.
wrapperMode - whether select, insert or update

getWrapperFunction

java.lang.String getWrapperFunction(int wrapperMode)
Gets the wrapper for parameters.

Parameters:
wrapperMode - whether select, insert or update
Returns:
Returns the wrapperFunction.


Copyright © 2009. All Rights Reserved.