Class OracleClobColumnMapping
- java.lang.Object
-
- org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
-
- org.datanucleus.store.rdbms.mapping.column.LongVarcharColumnMapping
-
- org.datanucleus.store.rdbms.mapping.column.ClobColumnMapping
-
- org.datanucleus.store.rdbms.mapping.column.OracleClobColumnMapping
-
- All Implemented Interfaces:
ColumnMapping,ColumnMappingPostInsert,ColumnMappingPostUpdate
public class OracleClobColumnMapping extends ClobColumnMapping implements ColumnMappingPostInsert, ColumnMappingPostUpdate
Mapping for an Oracle CLOB column. Extends the standard JDBC handler so that we can insert an empty CLOB, 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 Constructor Description OracleClobColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description StringgetInsertionInputParameter()Accessor for the string to put in any retrieval datastore statement for this field.ObjectgetObject(ResultSet rs, int param)Obtains a value fromresultSetat position specified byexprIndex.StringgetString(ResultSet rs, int param)Obtains a value fromresultSetat position specified byexprIndex.StringgetUpdateInputParameter()Accessor for the string to put in any update datastore statements for this field.booleanincludeInFetchStatement()Whether this mapping is included in the fetch statement.voidinsertPostProcessing(org.datanucleus.state.ObjectProvider op, Object value)Perform any INSERT post processing on this column, using the provided value.booleaninsertValuesOnInsert()Accessor for whether this mapping requires values inserting on an INSERT.static voidupdateClobColumn(org.datanucleus.state.ObjectProvider op, Table table, ColumnMapping mapping, String value)Convenience method to update the contents of a CLOB column.voidupdatePostProcessing(org.datanucleus.state.ObjectProvider op, Object value)Perform any UPDATE post processing on this column, using the provided value.-
Methods inherited from class org.datanucleus.store.rdbms.mapping.column.ClobColumnMapping
getJDBCType, setObject, setString
-
Methods inherited from class org.datanucleus.store.rdbms.mapping.column.LongVarcharColumnMapping
isStringBased
-
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, initTypeInfo, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, isNullable, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, useDefaultWhenNull
-
-
-
-
Constructor Detail
-
OracleClobColumnMapping
public OracleClobColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col)
-
-
Method Detail
-
getInsertionInputParameter
public String getInsertionInputParameter()
Description copied from class:AbstractColumnMappingAccessor 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:
getInsertionInputParameterin interfaceColumnMapping- Overrides:
getInsertionInputParameterin classAbstractColumnMapping- Returns:
- The input parameter
-
includeInFetchStatement
public boolean includeInFetchStatement()
Description copied from class:AbstractColumnMappingWhether this mapping is included in the fetch statement.- Overrides:
includeInFetchStatementin classAbstractColumnMapping- Returns:
- Whether to include in fetch statement
-
getUpdateInputParameter
public String getUpdateInputParameter()
Description copied from class:AbstractColumnMappingAccessor 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:
getUpdateInputParameterin interfaceColumnMapping- Overrides:
getUpdateInputParameterin classAbstractColumnMapping- Returns:
- The input parameter.
-
insertValuesOnInsert
public boolean insertValuesOnInsert()
Accessor for whether this mapping requires values inserting on an INSERT.- Specified by:
insertValuesOnInsertin interfaceColumnMapping- Overrides:
insertValuesOnInsertin classAbstractColumnMapping- Returns:
- Whether values are to be inserted into this mapping on an INSERT
-
getString
public String getString(ResultSet rs, int param)
Description copied from interface:ColumnMappingObtains a value fromresultSetat position specified byexprIndex.- Specified by:
getStringin interfaceColumnMapping- Overrides:
getStringin classClobColumnMapping- Parameters:
rs- ResultSetparam- the position of the value in the result- Returns:
- the value
-
getObject
public Object getObject(ResultSet rs, int param)
Description copied from interface:ColumnMappingObtains a value fromresultSetat position specified byexprIndex.- Specified by:
getObjectin interfaceColumnMapping- Overrides:
getObjectin classClobColumnMapping- Parameters:
rs- ResultSetparam- the position of the value in the result- Returns:
- the value
-
insertPostProcessing
public void insertPostProcessing(org.datanucleus.state.ObjectProvider op, Object value)Description copied from interface:ColumnMappingPostInsertPerform any INSERT post processing on this column, using the provided value.- Specified by:
insertPostProcessingin interfaceColumnMappingPostInsert- Parameters:
op- ObjectProvider for object being insertedvalue- The value to use on the insert
-
updatePostProcessing
public void updatePostProcessing(org.datanucleus.state.ObjectProvider op, Object value)Description copied from interface:ColumnMappingPostUpdatePerform any UPDATE post processing on this column, using the provided value.- Specified by:
updatePostProcessingin interfaceColumnMappingPostUpdate- Parameters:
op- ObjectProvider for object being updatedvalue- The value to use on the UPDATE
-
updateClobColumn
public static void updateClobColumn(org.datanucleus.state.ObjectProvider op, Table table, ColumnMapping mapping, String value)Convenience method to update the contents of a CLOB column. Oracle requires that a CLOB is initialised with EMPTY_CLOB() and then you retrieve the column and update its CLOB value. Performs a statementSELECT {clobColumn} FROM TABLE WHERE ID=? FOR UPDATEand then updates the Clob value returned.- Parameters:
op- ObjectProvider of the objecttable- Table storing the CLOB columnmapping- Datastore mapping for the CLOB columnvalue- The value to store in the CLOB- Throws:
org.datanucleus.exceptions.NucleusObjectNotFoundException- Thrown if an object is not foundorg.datanucleus.exceptions.NucleusDataStoreException- Thrown if an error occurs in datastore communication
-
-