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 intgetJDBCType()Method to return the java.sql.Types type that this relates to.ObjectgetObject(ResultSet rs, int param)Method to retrieve the object from the large binary column.StringgetString(ResultSet rs, int param)Accessor for String value when serialised.voidsetString(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:AbstractColumnMappingMethod to return the java.sql.Types type that this relates to.- Specified by:
getJDBCTypein classAbstractColumnMapping- Returns:
- The JDBC "type"
-
getObject
public Object getObject(ResultSet rs, int param)
Description copied from class:AbstractLargeBinaryColumnMappingMethod to retrieve the object from the large binary column.- Specified by:
getObjectin interfaceColumnMapping- Overrides:
getObjectin 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:AbstractLargeBinaryColumnMappingCater for serialisation of Strings.- Specified by:
setStringin interfaceColumnMapping- Overrides:
setStringin classAbstractLargeBinaryColumnMapping- Parameters:
ps- PreparedStatementparam- param indexesvalue- The value of the String
-
getString
public String getString(ResultSet rs, int param)
Description copied from class:AbstractLargeBinaryColumnMappingAccessor for String value when serialised.- Specified by:
getStringin interfaceColumnMapping- Overrides:
getStringin classAbstractLargeBinaryColumnMapping- Parameters:
rs- ResultSetparam- param indexes- Returns:
- The String value
-
-