com.triactive.jdo.store.mapping
Class OracleBlobMapping

java.lang.Object
  extended bycom.triactive.jdo.store.mapping.Mapping
      extended bycom.triactive.jdo.store.mapping.ColumnMapping
          extended bycom.triactive.jdo.store.mapping.ByteArrayMapping
              extended bycom.triactive.jdo.store.mapping.OracleBlobMapping
All Implemented Interfaces:
PostInsertProcessing, PostUpdateProcessing, PostWriteProcessing

public class OracleBlobMapping
extends ByteArrayMapping
implements PostInsertProcessing, PostUpdateProcessing


Field Summary
 
Fields inherited from class com.triactive.jdo.store.mapping.ColumnMapping
col, typeInfo
 
Fields inherited from class com.triactive.jdo.store.mapping.Mapping
dba, fmd, type
 
Constructor Summary
OracleBlobMapping(DatabaseAdapter dba, java.lang.Class type)
           
OracleBlobMapping(DatabaseAdapter dba, FieldMetaData fmd)
           
 
Method Summary
 TypeInfo chooseColumnType(Column col)
          Chooses an appropriate SQL type for a column based on the column's options.
 java.lang.Object getObject(PersistenceManager pm, java.sql.ResultSet rs, int param)
           
 java.lang.String getSqlInsertionValue()
          Returns the SQL text to be included in INSERT statements when inserting a value into this mapping's column.
 java.lang.String getSqlUpdateValue()
          Returns the SQL text to be included in UPDATE statements when updating a value in this mapping's column.
 void mapTo(Column col)
          Links this mapping to a specific column.
 void postInsert(StateManager sm, java.sql.Connection conn, java.lang.Object value)
          Called after a SQL INSERT has been performed.
 void postUpdate(StateManager sm, java.sql.Connection conn, java.lang.Object value)
          Retrieve the empty BLOB locator created by the insert statement and write out the current BLOB field value to the Oracle BLOB object
 void setObject(PersistenceManager pm, java.sql.PreparedStatement ps, int param, java.lang.Object value)
           
 
Methods inherited from class com.triactive.jdo.store.mapping.ByteArrayMapping
newSqlExpression, newSqlLiteral
 
Methods inherited from class com.triactive.jdo.store.mapping.ColumnMapping
accessAsFieldIn, defineConstraints, defineStorage, equals, getBoolean, getByte, getChar, getColumn, getDouble, getFloat, getInt, getLong, getShort, getString, getTypeInfo, hashCode, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, setString
 
Methods inherited from class com.triactive.jdo.store.mapping.Mapping
getDefaultMappingsByType, getFieldMetaData, getType
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

OracleBlobMapping

public OracleBlobMapping(DatabaseAdapter dba,
                         java.lang.Class type)

OracleBlobMapping

public OracleBlobMapping(DatabaseAdapter dba,
                         FieldMetaData fmd)
Method Detail

mapTo

public void mapTo(Column col)
Description copied from class: ColumnMapping
Links this mapping to a specific column. Linkage involves at least two steps:
  1. Calling the column's Column.mapWith(com.triactive.jdo.store.mapping.ColumnMapping) method
  2. Setting this mapping's ColumnMapping.typeInfo to match the column's

This method can be called at most once for a given mapping. Subclasses may do extra work as a consequence of mapping themselves to a column, but they should always call super.mapTo(col) first.

Overrides:
mapTo in class ByteArrayMapping

chooseColumnType

public TypeInfo chooseColumnType(Column col)
Description copied from class: ColumnMapping
Chooses an appropriate SQL type for a column based on the column's options.

Overrides:
chooseColumnType in class ByteArrayMapping

getSqlInsertionValue

public java.lang.String getSqlInsertionValue()
Description copied from class: ColumnMapping
Returns the SQL text to be included in INSERT statements when inserting a value into this mapping's column. This is usually "?" to indicate a JDBC statement parameter.

Overrides:
getSqlInsertionValue in class ColumnMapping

getSqlUpdateValue

public java.lang.String getSqlUpdateValue()
Description copied from class: ColumnMapping
Returns the SQL text to be included in UPDATE statements when updating a value in this mapping's column. This is usually "?" to indicate a JDBC statement parameter.

Overrides:
getSqlUpdateValue in class ColumnMapping

setObject

public void setObject(PersistenceManager pm,
                      java.sql.PreparedStatement ps,
                      int param,
                      java.lang.Object value)
Overrides:
setObject in class ByteArrayMapping

getObject

public java.lang.Object getObject(PersistenceManager pm,
                                  java.sql.ResultSet rs,
                                  int param)
Overrides:
getObject in class ByteArrayMapping

postInsert

public void postInsert(StateManager sm,
                       java.sql.Connection conn,
                       java.lang.Object value)
Description copied from interface: PostInsertProcessing
Called after a SQL INSERT has been performed.

Specified by:
postInsert in interface PostInsertProcessing
Parameters:
sm - The state manager of the instance owning the Java object being inserted.
conn - The connection on which the INSERT has been performed.
value - The column value being inserted.

postUpdate

public void postUpdate(StateManager sm,
                       java.sql.Connection conn,
                       java.lang.Object value)
Retrieve the empty BLOB locator created by the insert statement and write out the current BLOB field value to the Oracle BLOB object

Specified by:
postUpdate in interface PostUpdateProcessing
Parameters:
sm - The state manager of the instance owning the Java object being updated.
conn - The connection on which the UPDATE has been performed.
value - The column value being updated.


Copyright 2001-2007 The TJDO Project All Rights Reserved.