Class BooleanColumnMapping
java.lang.Object
org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
org.datanucleus.store.rdbms.mapping.column.BooleanColumnMapping
- All Implemented Interfaces:
ColumnMapping
- Direct Known Subclasses:
BitColumnMapping
Mapping of a BOOLEAN column.
-
Field Summary
Fields inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
column, mapping, storeMgr
-
Constructor Summary
ConstructorsConstructorDescriptionBooleanColumnMapping
(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col) Constructor. -
Method Summary
Modifier and TypeMethodDescriptionboolean
getBoolean
(ResultSet rs, int param) Obtains a value fromresultSet
at position specified byexprIndex
.int
Method to return the java.sql.Types type that this relates to.Obtains a value fromresultSet
at position specified byexprIndex
.Accessor for the value for a boolean field stored as a String datastore type.private void
boolean
Accessor for whether the mapping is boolean-based.void
setBoolean
(PreparedStatement ps, int param, boolean value) Sets avalue
intops
at position specified byparamIndex
.void
setObject
(PreparedStatement ps, int param, Object value) Sets avalue
intops
at position specified byparamIndex
.void
setString
(PreparedStatement ps, int param, String value) Setter for booleans stored as String datastore types.Methods inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
equals, failureMessage, failureMessage, failureMessage, getByte, getChar, getColumn, getDatastoreAdapter, getDouble, getFloat, getInsertionInputParameter, getInt, getJavaTypeMapping, getLong, getShort, getTypeInfo, getUpdateInputParameter, hashCode, includeInFetchStatement, initTypeInfo, insertValuesOnInsert, isBitBased, isDecimalBased, isIntegerBased, isNullable, isStringBased, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, useDefaultWhenNull
-
Constructor Details
-
BooleanColumnMapping
Constructor.- Parameters:
mapping
- Java type mappingstoreMgr
- Store Managercol
- column to be mapped
-
-
Method Details
-
initialize
private void initialize() -
isBooleanBased
public boolean isBooleanBased()Accessor for whether the mapping is boolean-based.- Specified by:
isBooleanBased
in interfaceColumnMapping
- Overrides:
isBooleanBased
in classAbstractColumnMapping
- Returns:
- Whether the mapping is boolean based
-
getJDBCType
public int getJDBCType()Description copied from class:AbstractColumnMapping
Method to return the java.sql.Types type that this relates to.- Specified by:
getJDBCType
in classAbstractColumnMapping
- Returns:
- The JDBC "type"
-
setBoolean
Description copied from interface:ColumnMapping
Sets avalue
intops
at position specified byparamIndex
.- Specified by:
setBoolean
in interfaceColumnMapping
- Overrides:
setBoolean
in classAbstractColumnMapping
- Parameters:
ps
- PreparedStatementparam
- the position of the value in the statementvalue
- the value
-
getBoolean
Description copied from interface:ColumnMapping
Obtains a value fromresultSet
at position specified byexprIndex
.- Specified by:
getBoolean
in interfaceColumnMapping
- Overrides:
getBoolean
in classAbstractColumnMapping
- Parameters:
rs
- ResultSetparam
- the position of the value in the result- Returns:
- the value
-
setString
Setter for booleans stored as String datastore types.- Specified by:
setString
in interfaceColumnMapping
- Overrides:
setString
in classAbstractColumnMapping
- Parameters:
ps
- PreparedStatementparam
- Number of the fieldvalue
- Value of the boolean
-
getString
Accessor for the value for a boolean field stored as a String datastore type.- Specified by:
getString
in interfaceColumnMapping
- Overrides:
getString
in classAbstractColumnMapping
- Parameters:
rs
- ResultSetparam
- number of the parameter.- Returns:
- The value
-
setObject
Description copied from interface:ColumnMapping
Sets avalue
intops
at position specified byparamIndex
.- Specified by:
setObject
in interfaceColumnMapping
- Overrides:
setObject
in classAbstractColumnMapping
- Parameters:
ps
- PreparedStatementparam
- the position of the value in the statementvalue
- the value
-
getObject
Description copied from interface:ColumnMapping
Obtains a value fromresultSet
at position specified byexprIndex
.- Specified by:
getObject
in interfaceColumnMapping
- Overrides:
getObject
in classAbstractColumnMapping
- Parameters:
rs
- ResultSetparam
- the position of the value in the result- Returns:
- the value
-