|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.datanucleus.store.rdbms.table.ColumnImpl
public class ColumnImpl
Implementation of a Column in an RDBMS datastore. Contains the full definition of the column, its type, size, whether it is identity, nullable, part of the PK etc. The SQL column definition is generated here.
| Field Summary | |
|---|---|
protected org.datanucleus.metadata.ColumnMetaData |
columnMetaData
ColumnMetaData for this column. |
protected String |
constraints
Optional constraints to apply to this column in its SQL specification. |
protected org.datanucleus.store.mapped.mapping.DatastoreMapping |
datastoreMapping
Datastore mapping for this column. |
protected Object |
defaultValue
Default value accepted by the datastore for this column, from DatabaseMetaData. |
protected byte |
flags
Operational flags, for nullability, PK, autoinc, etc. |
protected org.datanucleus.store.mapped.DatastoreIdentifier |
identifier
Identifier for the column in the datastore. |
protected String |
storedJavaType
Java type that this column is storing. |
protected org.datanucleus.store.mapped.DatastoreContainerObject |
table
Table containing this column in the datastore. |
protected SQLTypeInfo |
typeInfo
SQL Type info for the JDBC type being stored in this column |
protected String[] |
wrapperFunction
Function wrapping the column (for example, SQRT(COLUMN)). |
| Fields inherited from interface org.datanucleus.store.rdbms.table.Column |
|---|
WRAPPER_FUNCTION_INSERT, WRAPPER_FUNCTION_SELECT, WRAPPER_FUNCTION_UPDATE |
| Constructor Summary | |
|---|---|
ColumnImpl(org.datanucleus.store.mapped.DatastoreContainerObject table,
String javaType,
org.datanucleus.store.mapped.DatastoreIdentifier identifier,
org.datanucleus.metadata.ColumnMetaData colmd)
Constructor. |
|
| Method Summary | |
|---|---|
String |
applySelectFunction(String replacementValue)
|
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(org.datanucleus.store.mapped.DatastoreField field)
|
boolean |
equals(Object obj)
|
org.datanucleus.metadata.ColumnMetaData |
getColumnMetaData()
|
String |
getConstraints()
|
org.datanucleus.store.mapped.DatastoreContainerObject |
getDatastoreContainerObject()
|
org.datanucleus.store.mapped.mapping.DatastoreMapping |
getDatastoreMapping()
|
Object |
getDefaultValue()
|
org.datanucleus.store.mapped.DatastoreIdentifier |
getIdentifier()
|
org.datanucleus.store.mapped.mapping.JavaTypeMapping |
getJavaTypeMapping()
|
int |
getJdbcType()
Accessor for the JDBC type being used for this Column |
org.datanucleus.metadata.AbstractMemberMetaData |
getMemberMetaData()
|
String |
getSQLDefinition()
Accessor for the SQL definition of this column. |
String |
getStoredJavaType()
|
org.datanucleus.store.mapped.MappedStoreManager |
getStoreManager()
|
SQLTypeInfo |
getTypeInfo()
Accessor for the type info for this column. |
String |
getWrapperFunction(int wrapperMode)
Gets the wrapper for parameters. |
int |
hashCode()
|
void |
initializeColumnInfoFromDatastore(RDBMSColumnInfo ci)
Initialize the default column value and auto increment |
boolean |
isDefaultable()
|
boolean |
isIdentity()
|
boolean |
isNullable()
|
boolean |
isPrimaryKey()
|
boolean |
isUnique()
|
boolean |
isUnlimitedLength()
Convenience method to check if the length is required to be unlimited (BLOB/CLOB). |
void |
setAsPrimaryKey()
|
void |
setColumnMetaData(org.datanucleus.metadata.ColumnMetaData colmd)
|
Column |
setConstraints(String constraints)
Mutator for the constraints of the column. |
void |
setDatastoreMapping(org.datanucleus.store.mapped.mapping.DatastoreMapping mapping)
|
org.datanucleus.store.mapped.DatastoreField |
setDefaultable()
|
void |
setDefaultValue(Object object)
|
void |
setIdentifier(org.datanucleus.store.mapped.DatastoreIdentifier identifier)
|
org.datanucleus.store.mapped.DatastoreField |
setIdentity(boolean identity)
|
org.datanucleus.store.mapped.DatastoreField |
setNullable()
|
Column |
setTypeInfo(SQLTypeInfo typeInfo)
Mutator for the type information of the column. |
org.datanucleus.store.mapped.DatastoreField |
setUnique()
|
void |
setWrapperFunction(String wrapperFunction,
int wrapperMode)
Sets a function to wrap the column. |
String |
toString()
|
void |
validate(RDBMSColumnInfo ci)
Method to validate the contents of the column. |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, notify, notifyAll, wait, wait, wait |
| Field Detail |
|---|
protected org.datanucleus.store.mapped.DatastoreIdentifier identifier
protected org.datanucleus.metadata.ColumnMetaData columnMetaData
protected final org.datanucleus.store.mapped.DatastoreContainerObject table
protected org.datanucleus.store.mapped.mapping.DatastoreMapping datastoreMapping
protected final String storedJavaType
protected SQLTypeInfo typeInfo
protected String constraints
protected byte flags
protected Object defaultValue
protected String[] wrapperFunction
| Constructor Detail |
|---|
public ColumnImpl(org.datanucleus.store.mapped.DatastoreContainerObject table,
String javaType,
org.datanucleus.store.mapped.DatastoreIdentifier identifier,
org.datanucleus.metadata.ColumnMetaData colmd)
table - The table in the datastore that this column belongs to.javaType - The type of data being stored in this columnidentifier - The identifier of the column (in the datastore).colmd - The ColumnMetaData for this column| Method Detail |
|---|
public boolean isUnlimitedLength()
Column
isUnlimitedLength in interface Columnpublic org.datanucleus.store.mapped.DatastoreIdentifier getIdentifier()
getIdentifier in interface org.datanucleus.store.mapped.DatastoreFieldpublic void setIdentifier(org.datanucleus.store.mapped.DatastoreIdentifier identifier)
setIdentifier in interface org.datanucleus.store.mapped.DatastoreFieldpublic org.datanucleus.store.mapped.DatastoreContainerObject getDatastoreContainerObject()
getDatastoreContainerObject in interface org.datanucleus.store.mapped.DatastoreFieldpublic org.datanucleus.store.mapped.mapping.DatastoreMapping getDatastoreMapping()
getDatastoreMapping in interface org.datanucleus.store.mapped.DatastoreFieldpublic void setDatastoreMapping(org.datanucleus.store.mapped.mapping.DatastoreMapping mapping)
setDatastoreMapping in interface org.datanucleus.store.mapped.DatastoreFieldpublic org.datanucleus.store.mapped.mapping.JavaTypeMapping getJavaTypeMapping()
getJavaTypeMapping in interface org.datanucleus.store.mapped.DatastoreFieldpublic String getStoredJavaType()
getStoredJavaType in interface org.datanucleus.store.mapped.DatastoreFieldpublic final SQLTypeInfo getTypeInfo()
Column
getTypeInfo in interface Columnpublic int getJdbcType()
Column
getJdbcType in interface Columnpublic org.datanucleus.store.mapped.MappedStoreManager getStoreManager()
getStoreManager in interface org.datanucleus.store.mapped.DatastoreFieldpublic String getSQLDefinition()
Column
getSQLDefinition in interface Columnpublic void initializeColumnInfoFromDatastore(RDBMSColumnInfo ci)
Column
initializeColumnInfoFromDatastore in interface Columnci - The column informationpublic void validate(RDBMSColumnInfo ci)
Column
validate in interface Columnci - The column information taken from the databasepublic final Column setTypeInfo(SQLTypeInfo typeInfo)
Column
setTypeInfo in interface ColumntypeInfo - The type info
public final Column setConstraints(String constraints)
Column
setConstraints in interface Columnconstraints - The constraints
public final void setAsPrimaryKey()
setAsPrimaryKey in interface org.datanucleus.store.mapped.DatastoreFieldpublic final org.datanucleus.store.mapped.DatastoreField setNullable()
setNullable in interface org.datanucleus.store.mapped.DatastoreFieldpublic final org.datanucleus.store.mapped.DatastoreField setDefaultable()
setDefaultable in interface org.datanucleus.store.mapped.DatastoreFieldpublic final org.datanucleus.store.mapped.DatastoreField setUnique()
setUnique in interface org.datanucleus.store.mapped.DatastoreFieldpublic org.datanucleus.store.mapped.DatastoreField setIdentity(boolean identity)
setIdentity in interface org.datanucleus.store.mapped.DatastoreFieldpublic final boolean isPrimaryKey()
isPrimaryKey in interface org.datanucleus.store.mapped.DatastoreFieldpublic final boolean isNullable()
isNullable in interface org.datanucleus.store.mapped.DatastoreFieldpublic final boolean isDefaultable()
isDefaultable in interface org.datanucleus.store.mapped.DatastoreFieldpublic final boolean isUnique()
isUnique in interface org.datanucleus.store.mapped.DatastoreFieldpublic boolean isIdentity()
isIdentity in interface org.datanucleus.store.mapped.DatastoreFieldpublic String applySelectFunction(String replacementValue)
applySelectFunction in interface org.datanucleus.store.mapped.DatastoreFieldpublic Object getDefaultValue()
getDefaultValue in interface org.datanucleus.store.mapped.DatastoreFieldpublic void setDefaultValue(Object object)
setDefaultValue in interface org.datanucleus.store.mapped.DatastoreFieldpublic final org.datanucleus.metadata.ColumnMetaData getColumnMetaData()
getColumnMetaData in interface org.datanucleus.store.mapped.DatastoreFieldpublic org.datanucleus.metadata.AbstractMemberMetaData getMemberMetaData()
getMemberMetaData in interface org.datanucleus.store.mapped.DatastoreFieldpublic void setColumnMetaData(org.datanucleus.metadata.ColumnMetaData colmd)
setColumnMetaData in interface org.datanucleus.store.mapped.DatastoreFieldpublic String getConstraints()
getConstraints in interface Column
public final void checkPrimitive()
throws org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
Column
checkPrimitive in interface Columnorg.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
public final void checkInteger()
throws org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
Column
checkInteger in interface Columnorg.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
public final void checkDecimal()
throws org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
Column
checkDecimal in interface Columnorg.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
public final void checkString()
throws org.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionException
Column
checkString in interface Columnorg.datanucleus.store.mapped.exceptions.DatastoreFieldDefinitionExceptionpublic void copyConfigurationTo(org.datanucleus.store.mapped.DatastoreField field)
copyConfigurationTo in interface org.datanucleus.store.mapped.DatastoreField
public void setWrapperFunction(String wrapperFunction,
int wrapperMode)
ColumnSQRT(?) generates: SQRT(COLUMN)
setWrapperFunction in interface ColumnwrapperFunction - The wrapperFunction to set.wrapperMode - whether select, insert or updatepublic String getWrapperFunction(int wrapperMode)
Column
getWrapperFunction in interface ColumnwrapperMode - whether select, insert or update
public boolean equals(Object obj)
equals in class Objectpublic int hashCode()
hashCode in class Objectpublic String toString()
toString in class Object
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||