Class BlobColumnMapping
- java.lang.Object
-
- org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
-
- org.datanucleus.store.rdbms.mapping.column.AbstractLargeBinaryColumnMapping
-
- org.datanucleus.store.rdbms.mapping.column.BlobColumnMapping
-
- All Implemented Interfaces:
ColumnMapping
public class BlobColumnMapping extends AbstractLargeBinaryColumnMapping
Mapping of a BLOB column. A BLOB column can be treated in two ways in terms of storage and retrieval.- Serialise the field into the BLOB using ObjectOutputStream, and deserialise it back using ObjectInputStream
- Store the field using a byte[] stream, and retrieve it in the same way.
-
-
Field Summary
-
Fields inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
column, mapping, storeMgr
-
-
Constructor Summary
Constructors Constructor Description BlobColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description int
getJDBCType()
Method to return the java.sql.Types type that this relates to.Object
getObject(ResultSet rs, int param)
Method to retrieve the object from the large binary column.String
getString(ResultSet rs, int param)
Accessor for String value when serialised.void
setString(PreparedStatement ps, int param, String value)
Cater for serialisation of Strings.-
Methods inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractLargeBinaryColumnMapping
getObjectForBytes, initialize, setObject
-
Methods inherited from class org.datanucleus.store.rdbms.mapping.column.AbstractColumnMapping
equals, failureMessage, failureMessage, failureMessage, getBoolean, getByte, getChar, getColumn, getDatastoreAdapter, getDouble, getFloat, getInsertionInputParameter, getInt, getJavaTypeMapping, getLong, getShort, getTypeInfo, getUpdateInputParameter, hashCode, includeInFetchStatement, initTypeInfo, insertValuesOnInsert, isBitBased, isBooleanBased, isDecimalBased, isIntegerBased, isNullable, isStringBased, setBoolean, setByte, setChar, setDouble, setFloat, setInt, setLong, setShort, useDefaultWhenNull
-
-
-
-
Constructor Detail
-
BlobColumnMapping
public BlobColumnMapping(JavaTypeMapping mapping, RDBMSStoreManager storeMgr, Column col)
Constructor.- Parameters:
mapping
- Java type mappingstoreMgr
- Store Managercol
- Column
-
-
Method Detail
-
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"
-
getObject
public Object getObject(ResultSet rs, int param)
Description copied from class:AbstractLargeBinaryColumnMapping
Method to retrieve the object from the large binary column.- Specified by:
getObject
in interfaceColumnMapping
- Overrides:
getObject
in classAbstractLargeBinaryColumnMapping
- Parameters:
rs
- The ResultSetparam
- The parameter position- Returns:
- The object
-
setString
public void setString(PreparedStatement ps, int param, String value)
Description copied from class:AbstractLargeBinaryColumnMapping
Cater for serialisation of Strings.- Specified by:
setString
in interfaceColumnMapping
- Overrides:
setString
in classAbstractLargeBinaryColumnMapping
- Parameters:
ps
- PreparedStatementparam
- param indexesvalue
- The value of the String
-
getString
public String getString(ResultSet rs, int param)
Description copied from class:AbstractLargeBinaryColumnMapping
Accessor for String value when serialised.- Specified by:
getString
in interfaceColumnMapping
- Overrides:
getString
in classAbstractLargeBinaryColumnMapping
- Parameters:
rs
- ResultSetparam
- param indexes- Returns:
- The String value
-
-