Class OracleBlobColumnMapping
- java.lang.Object
-
- org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
-
- org.datanucleus.store.rdbms.mapping.column.OracleBlobColumnMapping
-
- All Implemented Interfaces:
ColumnMapping
,ColumnMappingPostSet
public class OracleBlobColumnMapping extends AbstractColumnMapping implements ColumnMappingPostSet
Mapping for an Oracle BLOB column. Extends the standard JDBC handler so that we can insert an empty BLOB, and then update it (Oracle non-standard behaviour).
-
-
Field Summary
-
Fields inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
column, mapping, storeMgr
-
-
Constructor Summary
Constructors Modifier Constructor Description OracleBlobColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col)
Constructor.protected
OracleBlobColumnMapping(RDBMSStoreManager storeMgr, JavaTypeMapping mapping)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description String
getInsertionInputParameter()
Accessor for the string to put in any retrieval datastore statement for this field.int
getJDBCType()
Method to return the java.sql.Types type that this relates to.Object
getObject(ResultSet rs, int param)
Returns the object to be loaded from the Orale BLOB.String
getString(ResultSet resultSet, int exprIndex)
Obtains a value fromresultSet
at position specified byexprIndex
.String
getUpdateInputParameter()
Accessor for the string to put in any update datastore statements for this field.boolean
includeInSQLFetchStatement()
Whether to include this mapping in a fetch statement.boolean
insertValuesOnInsert()
Accessor for whether this mapping requires values inserting on an INSERT.void
setPostProcessing(org.datanucleus.state.DNStateManager sm, Object value)
Perform any post "set" processing on this column, using the provided value.-
Methods inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
equals, failureMessage, failureMessage, failureMessage, getBoolean, getByte, getChar, getColumn, getDatastoreAdapter, getDouble, getFloat, getInt, getJavaTypeMapping, getLong, getShort, getTypeInfo, hashCode, includeInFetchStatement, initTypeInfo, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, isNullable, isStringBased, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setObject, setShort, setString, useDefaultWhenNull
-
-
-
-
Constructor Detail
-
OracleBlobColumnMapping
public OracleBlobColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col)
Constructor.- Parameters:
mapping
- The Java mappingstoreMgr
- Store Manager in usecol
- Column
-
OracleBlobColumnMapping
protected OracleBlobColumnMapping(RDBMSStoreManager storeMgr, JavaTypeMapping mapping)
Constructor.- Parameters:
storeMgr
- Store Managermapping
- The Java mapping
-
-
Method Detail
-
getInsertionInputParameter
public String getInsertionInputParameter()
Description copied from class:AbstractColumnMapping
Accessor for the string to put in any retrieval datastore statement for this field. In RDBMS, this is typically a ? to be used in JDBC statements.- Specified by:
getInsertionInputParameter
in interfaceColumnMapping
- Overrides:
getInsertionInputParameter
in classAbstractColumnMapping
- Returns:
- The input parameter
- See Also:
AbstractColumnMapping.getInsertionInputParameter()
-
insertValuesOnInsert
public boolean insertValuesOnInsert()
Accessor for whether this mapping requires values inserting on an INSERT.- Specified by:
insertValuesOnInsert
in interfaceColumnMapping
- Overrides:
insertValuesOnInsert
in classAbstractColumnMapping
- Returns:
- Whether values are to be inserted into this mapping on an INSERT
-
getObject
public Object getObject(ResultSet rs, int param)
Returns the object to be loaded from the Orale BLOB.- Specified by:
getObject
in interfaceColumnMapping
- Overrides:
getObject
in classAbstractColumnMapping
- Parameters:
rs
- the ResultSet from the queryparam
- the index in the query- Returns:
- the object loaded as a byte[]
- Throws:
org.datanucleus.exceptions.NucleusDataStoreException
- Thrown if an error occurs in datastore communication
-
getString
public String getString(ResultSet resultSet, int exprIndex)
Description copied from interface:ColumnMapping
Obtains a value fromresultSet
at position specified byexprIndex
.- Specified by:
getString
in interfaceColumnMapping
- Overrides:
getString
in classAbstractColumnMapping
- Parameters:
resultSet
- ResultSetexprIndex
- the position of the value in the result- Returns:
- the value
- See Also:
AbstractColumnMapping.getString(ResultSet, int)
-
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"
-
getUpdateInputParameter
public String getUpdateInputParameter()
Description copied from class:AbstractColumnMapping
Accessor for the string to put in any update datastore statements for this field. In RDBMS, this is typically a ? to be used in JDBC statements.- Specified by:
getUpdateInputParameter
in interfaceColumnMapping
- Overrides:
getUpdateInputParameter
in classAbstractColumnMapping
- Returns:
- The input parameter.
- See Also:
AbstractColumnMapping.getUpdateInputParameter()
-
includeInSQLFetchStatement
public boolean includeInSQLFetchStatement()
Whether to include this mapping in a fetch statement.- Returns:
- Whether to include it when fetching the object
-
setPostProcessing
public void setPostProcessing(org.datanucleus.state.DNStateManager sm, Object value)
Description copied from interface:ColumnMappingPostSet
Perform any post "set" processing on this column, using the provided value.- Specified by:
setPostProcessing
in interfaceColumnMappingPostSet
- Parameters:
sm
- StateManager for object being setvalue
- The value to use on the set
-
-