Class CharColumnMapping
java.lang.Object
org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
org.datanucleus.store.rdbms.mapping.column.CharColumnMapping
- All Implemented Interfaces:
ColumnMapping
- Direct Known Subclasses:
DB2DatalinkColumnMapping, NCharColumnMapping, VarCharColumnMapping
Mapping of a CHAR column.
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprivate static final ThreadLocal<CharColumnMapping.FormatterInfo> Fields inherited from class AbstractColumnMapping
column, mapping, storeMgr -
Constructor Summary
ConstructorsConstructorDescriptionCharColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionbooleangetBoolean(ResultSet rs, int param) Method to extract a boolean from the ResultSet at the specified positioncharMethod to extract a character from the ResultSet at the specified positionGet a Format object to handle java.util.Date.intMethod to return the java.sql.Types type that this relates to.Method to extract an object from the ResultSet at the specified positionMethod to extract a String from the ResultSet at the specified positionprotected voidMethod to initialise the column mapping.booleanAccessor for whether the mapping is string-based.voidsetBoolean(PreparedStatement ps, int param, boolean value) Method to set a boolean at the specified position in the JDBC PreparedStatement.voidsetChar(PreparedStatement ps, int param, char value) Method to set a character at the specified position in the JDBC PreparedStatement.voidsetObject(PreparedStatement ps, int param, Object value) Method to set an object at the specified position in the JDBC PreparedStatement.voidsetString(PreparedStatement ps, int param, String value) Method to set a String at the specified position in the JDBC PreparedStatement.Methods inherited from class AbstractColumnMapping
equals, failureMessage, failureMessage, failureMessage, getByte, getColumn, getDatastoreAdapter, getDouble, getFloat, getInsertionInputParameter, getInt, getJavaTypeMapping, getLong, getShort, getTypeInfo, getUpdateInputParameter, hashCode, includeInFetchStatement, initTypeInfo, insertValuesOnInsert, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, isNullable, setByte, setDouble, setFloat, setInt, setLong, setShort, useDefaultWhenNull
-
Field Details
-
formatterThreadInfo
-
-
Constructor Details
-
CharColumnMapping
Constructor.- Parameters:
mapping- Java type mappingstoreMgr- Store Managercol- column to be mapped
-
-
Method Details
-
initialize
protected void initialize()Method to initialise the column mapping. Provides default length specifications for the CHAR column to fit the data being stored. -
isStringBased
public boolean isStringBased()Accessor for whether the mapping is string-based.- Specified by:
isStringBasedin interfaceColumnMapping- Overrides:
isStringBasedin classAbstractColumnMapping- Returns:
- Whether the mapping is string based
-
getJDBCType
public int getJDBCType()Description copied from class:AbstractColumnMappingMethod to return the java.sql.Types type that this relates to.- Specified by:
getJDBCTypein classAbstractColumnMapping- Returns:
- The JDBC "type"
-
setChar
Method to set a character at the specified position in the JDBC PreparedStatement.- Specified by:
setCharin interfaceColumnMapping- Overrides:
setCharin classAbstractColumnMapping- Parameters:
ps- The PreparedStatementparam- Parameter positionvalue- The value to set
-
getChar
Method to extract a character from the ResultSet at the specified position- Specified by:
getCharin interfaceColumnMapping- Overrides:
getCharin classAbstractColumnMapping- Parameters:
rs- The Result Setparam- The parameter position- Returns:
- the character
-
setString
Method to set a String at the specified position in the JDBC PreparedStatement.- Specified by:
setStringin interfaceColumnMapping- Overrides:
setStringin classAbstractColumnMapping- Parameters:
ps- The PreparedStatementparam- Parameter positionvalue- The value to set
-
getString
Method to extract a String from the ResultSet at the specified position- Specified by:
getStringin interfaceColumnMapping- Overrides:
getStringin classAbstractColumnMapping- Parameters:
rs- The Result Setparam- The parameter position- Returns:
- the String
-
setBoolean
Method to set a boolean at the specified position in the JDBC PreparedStatement.- Specified by:
setBooleanin interfaceColumnMapping- Overrides:
setBooleanin classAbstractColumnMapping- Parameters:
ps- The PreparedStatementparam- Parameter positionvalue- The value to set
-
getBoolean
Method to extract a boolean from the ResultSet at the specified position- Specified by:
getBooleanin interfaceColumnMapping- Overrides:
getBooleanin classAbstractColumnMapping- Parameters:
rs- The Result Setparam- The parameter position- Returns:
- the boolean
-
setObject
Method to set an object at the specified position in the JDBC PreparedStatement.- Specified by:
setObjectin interfaceColumnMapping- Overrides:
setObjectin classAbstractColumnMapping- Parameters:
ps- The PreparedStatementparam- Parameter positionvalue- The value to set
-
getObject
Method to extract an object from the ResultSet at the specified position- Specified by:
getObjectin interfaceColumnMapping- Overrides:
getObjectin classAbstractColumnMapping- Parameters:
rs- The Result Setparam- The parameter position- Returns:
- the object
-
getJavaUtilDateFormat
Get a Format object to handle java.util.Date. If a TimeZone is present, it will be used to format dates to that zone.- Returns:
- Date formatter to use
-