public interface Column
Modifier and Type | Field and Description |
---|---|
static int |
WRAPPER_FUNCTION_INSERT
wrapper function insert
|
static int |
WRAPPER_FUNCTION_SELECT
wrapper function select
|
static int |
WRAPPER_FUNCTION_UPDATE
wrapper function update
|
Modifier and Type | Method and Description |
---|---|
String |
applySelectFunction(String replacementValue)
Wraps the column name with a FUNCTION.
|
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.
|
void |
copyConfigurationTo(Column col)
Copy the configuration of this field to another field
|
org.datanucleus.metadata.ColumnMetaData |
getColumnMetaData()
Access the metadata definition defining this column.
|
String |
getConstraints() |
DatastoreMapping |
getDatastoreMapping()
Accessor for the datastore mapping that this datastore field relates to.
|
Object |
getDefaultValue()
Accessor for the default Value
|
DatastoreIdentifier |
getIdentifier()
Accessor for the identifier for this object.
|
JavaTypeMapping |
getJavaTypeMapping()
Accessor for the JavaTypeMapping for the field/property that owns this column.
|
int |
getJdbcType()
Accessor for the JDBC type being used for this Column
|
org.datanucleus.metadata.AbstractMemberMetaData |
getMemberMetaData()
Accessor for the MetaData of the field/property that this is the datastore field for.
|
String |
getSQLDefinition()
Accessor for the SQL definition of this column.
|
String |
getStoredJavaType()
Accessor for the type of data stored in this field.
|
RDBMSStoreManager |
getStoreManager()
Accessor for the StoreManager for this table.
|
Table |
getTable()
Accessor for the table for this column
|
SQLTypeInfo |
getTypeInfo()
Accessor for the type info for this column.
|
String |
getWrapperFunction(int wrapperMode)
Gets the wrapper for parameters.
|
void |
initializeColumnInfoFromDatastore(RDBMSColumnInfo ci)
Initialize the default column value and auto increment
|
boolean |
isDefaultable()
Accessor for whether the column is defaultable.
|
boolean |
isIdentity()
Accessor for the whether this column is an identity column.
|
boolean |
isNullable()
Accessor for whether the field is nullable in the datastore.
|
boolean |
isPrimaryKey()
Accessor for whether the field is the primary key in the datastore.
|
boolean |
isUnique()
Accessor for whether the column is unique.
|
boolean |
isUnlimitedLength()
Convenience method to check if the length is required to be unlimited (BLOB/CLOB).
|
void |
setAsPrimaryKey()
Mutator to make the field the primary key.
|
void |
setColumnMetaData(org.datanucleus.metadata.ColumnMetaData md)
Method to set the MetaData for this datastore field.
|
Column |
setConstraints(String constraints)
Mutator for the constraints of the column.
|
void |
setDatastoreMapping(DatastoreMapping mapping)
Method to associate this datastore field with its mapping.
|
Column |
setDefaultable()
Mutator for the defaultability of the datastore field.
|
void |
setDefaultValue(Object object)
Mutator for the default Value
|
void |
setIdentifier(DatastoreIdentifier identifier)
Mutator for the identifier of the column.
|
Column |
setIdentity(boolean identity)
Mutator for whether we set this column as an identity column.
|
Column |
setNullable()
Mutator for the nullability of the datastore field.
|
Column |
setTypeInfo(SQLTypeInfo typeInfo)
Mutator for the type information of the column.
|
Column |
setUnique()
Mutator for the uniqueness of the column.
|
void |
setWrapperFunction(String wrapperFunction,
int wrapperMode)
Sets a function to wrap the column.
|
void |
validate(RDBMSColumnInfo ci)
Method to validate the contents of the column.
|
static final int WRAPPER_FUNCTION_SELECT
static final int WRAPPER_FUNCTION_INSERT
static final int WRAPPER_FUNCTION_UPDATE
RDBMSStoreManager getStoreManager()
String getStoredJavaType()
void setIdentifier(DatastoreIdentifier identifier)
identifier
- The identifierDatastoreIdentifier getIdentifier()
void setAsPrimaryKey()
boolean isPrimaryKey()
Column setNullable()
boolean isNullable()
Column setDefaultable()
boolean isDefaultable()
Column setUnique()
boolean isUnique()
Column setIdentity(boolean identity)
identity
- True if column is identityboolean isIdentity()
void setDefaultValue(Object object)
object
- default valueObject getDefaultValue()
void setDatastoreMapping(DatastoreMapping mapping)
mapping
- The mapping for this datastore fieldDatastoreMapping getDatastoreMapping()
void setColumnMetaData(org.datanucleus.metadata.ColumnMetaData md)
md
- The MetaDataorg.datanucleus.metadata.ColumnMetaData getColumnMetaData()
JavaTypeMapping getJavaTypeMapping()
Table getTable()
String applySelectFunction(String replacementValue)
example: SQRT(?) generates: SQRT(columnName)
replacementValue
- the replacement to ?. Probably it's a column name, that may be fully qualified name or notvoid copyConfigurationTo(Column col)
col
- the column to copyorg.datanucleus.metadata.AbstractMemberMetaData getMemberMetaData()
boolean isUnlimitedLength()
Column setTypeInfo(SQLTypeInfo typeInfo)
typeInfo
- The type infoSQLTypeInfo getTypeInfo()
int getJdbcType()
String getSQLDefinition()
void initializeColumnInfoFromDatastore(RDBMSColumnInfo ci)
ci
- The column informationvoid validate(RDBMSColumnInfo ci)
ci
- The column information taken from the databaseColumn setConstraints(String constraints)
constraints
- The constraintsString getConstraints()
void checkPrimitive() throws ColumnDefinitionException
ColumnDefinitionException
void checkInteger() throws ColumnDefinitionException
ColumnDefinitionException
void checkDecimal() throws ColumnDefinitionException
ColumnDefinitionException
void checkString() throws ColumnDefinitionException
ColumnDefinitionException
void setWrapperFunction(String wrapperFunction, int wrapperMode)
SQRT(?) generates: SQRT(COLUMN)
wrapperFunction
- The wrapperFunction to set.wrapperMode
- whether select, insert or updateString getWrapperFunction(int wrapperMode)
wrapperMode
- whether select, insert or updateCopyright © 2023. All rights reserved.