org.datanucleus.store.rdbms.mapping.oracle
Class OracleClobRDBMSMapping

java.lang.Object
  extended by org.datanucleus.store.mapped.mapping.AbstractDatastoreMapping
      extended by org.datanucleus.store.rdbms.mapping.RDBMSMapping
          extended by org.datanucleus.store.rdbms.mapping.LongVarcharRDBMSMapping
              extended by org.datanucleus.store.rdbms.mapping.ClobRDBMSMapping
                  extended by org.datanucleus.store.rdbms.mapping.oracle.OracleClobRDBMSMapping
All Implemented Interfaces:
org.datanucleus.store.mapped.mapping.DatastoreMapping

public class OracleClobRDBMSMapping
extends ClobRDBMSMapping

Mapping for Oracle CLOB type.


Field Summary
 
Fields inherited from class org.datanucleus.store.rdbms.mapping.RDBMSMapping
column, LOCALISER_RDBMS, storeMgr
 
Fields inherited from class org.datanucleus.store.mapped.mapping.AbstractDatastoreMapping
LOCALISER, mapping
 
Constructor Summary
  OracleClobRDBMSMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping, org.datanucleus.store.mapped.MappedStoreManager storeMgr, org.datanucleus.store.mapped.DatastoreField field)
          Constructor.
protected OracleClobRDBMSMapping(org.datanucleus.store.mapped.MappedStoreManager storeMgr, org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
          Constructor
 
Method Summary
 java.lang.String getInsertionInputParameter()
          Accessor for the string to put in any retrieval datastore statement for this field.
 java.lang.Object getObject(java.lang.Object rs, int param)
           
 java.lang.String getString(java.lang.Object rs, int param)
           
 SQLTypeInfo getTypeInfo()
          Accessor for the type info for this datastore field
 java.lang.String getUpdateInputParameter()
          Accessor for the string to put in any update datastore statements for this field.
 boolean includeInFetchStatement()
          Whether this mapping is included in the fetch statement.
 boolean insertValuesOnInsert()
          Accessor for whether this mapping requires values inserting on an INSERT.
static void updateClobColumn(org.datanucleus.store.ObjectProvider sm, org.datanucleus.store.mapped.DatastoreContainerObject datastoreContainer, org.datanucleus.store.mapped.mapping.DatastoreMapping mapping, java.lang.String value)
          Convenience method to update the contents of a CLOB column.
 
Methods inherited from class org.datanucleus.store.rdbms.mapping.ClobRDBMSMapping
setObject, setString
 
Methods inherited from class org.datanucleus.store.rdbms.mapping.LongVarcharRDBMSMapping
isStringBased
 
Methods inherited from class org.datanucleus.store.rdbms.mapping.RDBMSMapping
equals, failureMessage, failureMessage, getDatabaseAdapter, getDatastoreField, hashCode, initTypeInfo, isNullable
 
Methods inherited from class org.datanucleus.store.mapped.mapping.AbstractDatastoreMapping
failureMessage, getBoolean, getByte, getChar, getDouble, getFloat, getInt, getJavaTypeMapping, getLong, getShort, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleClobRDBMSMapping

protected OracleClobRDBMSMapping(org.datanucleus.store.mapped.MappedStoreManager storeMgr,
                                 org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping)
Constructor

Parameters:
storeMgr - Store Manager
mapping - The Java type mapping

OracleClobRDBMSMapping

public OracleClobRDBMSMapping(org.datanucleus.store.mapped.mapping.JavaTypeMapping mapping,
                              org.datanucleus.store.mapped.MappedStoreManager storeMgr,
                              org.datanucleus.store.mapped.DatastoreField field)
Constructor.

Parameters:
mapping - The java type mapping for the field.
storeMgr - Manager for the store
field - The field
Method Detail

getTypeInfo

public SQLTypeInfo getTypeInfo()
Description copied from class: ClobRDBMSMapping
Accessor for the type info for this datastore field

Overrides:
getTypeInfo in class ClobRDBMSMapping
Returns:
Type info for the datastore field

getInsertionInputParameter

public java.lang.String getInsertionInputParameter()
Description copied from class: RDBMSMapping
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.

Overrides:
getInsertionInputParameter in class RDBMSMapping
Returns:
The input parameter

includeInFetchStatement

public boolean includeInFetchStatement()
Description copied from class: RDBMSMapping
Whether this mapping is included in the fetch statement.

Overrides:
includeInFetchStatement in class RDBMSMapping
Returns:
Whether to include in fetch statement

getUpdateInputParameter

public java.lang.String getUpdateInputParameter()
Description copied from class: RDBMSMapping
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.

Overrides:
getUpdateInputParameter in class RDBMSMapping
Returns:
The input parameter.

insertValuesOnInsert

public boolean insertValuesOnInsert()
Accessor for whether this mapping requires values inserting on an INSERT.

Overrides:
insertValuesOnInsert in class RDBMSMapping
Returns:
Whether values are to be inserted into this mapping on an INSERT

getString

public java.lang.String getString(java.lang.Object rs,
                                  int param)
Specified by:
getString in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
getString in class ClobRDBMSMapping

getObject

public java.lang.Object getObject(java.lang.Object rs,
                                  int param)
Specified by:
getObject in interface org.datanucleus.store.mapped.mapping.DatastoreMapping
Overrides:
getObject in class ClobRDBMSMapping

updateClobColumn

public static void updateClobColumn(org.datanucleus.store.ObjectProvider sm,
                                    org.datanucleus.store.mapped.DatastoreContainerObject datastoreContainer,
                                    org.datanucleus.store.mapped.mapping.DatastoreMapping mapping,
                                    java.lang.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 statement
 SELECT {clobColumn} FROM TABLE WHERE ID=? FOR UPDATE
 
and then updates the Clob value returned.

Parameters:
sm - StateManager of the object
datastoreContainer - Table storing the CLOB column
mapping - Datastore mapping for the CLOB column
value - The value to store in the CLOB
Throws:
org.datanucleus.exceptions.NucleusObjectNotFoundException
org.datanucleus.exceptions.NucleusDataStoreException


Copyright © 2010. All Rights Reserved.