public class PostgresqlLargeObjectStorageManager extends RelationalDatabaseStorageManager
DatabaseStorageManager.InputStreamBlobactiveConnection, changes, factory, inTransaction, OBJ2TYPE_MAX_SIZE, sequenceKeys, transactionIsolation, typeCache| Constructor and Description |
|---|
PostgresqlLargeObjectStorageManager() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
delete(MMObjectNode node,
MMObjectBuilder builder,
List<CoreField> blobFileField,
String tablename)
Deletes all references LargeObjects and calls the overridden method in
its super class afterwards.
|
protected void |
deleteLargeObjects(MMObjectNode node,
MMObjectBuilder builder,
List<CoreField> blobFileField)
Delete all binary objects stored as large object.
|
protected Connection |
getActiveConnection()
Get the active connection.
|
protected Blob |
getBlobValue(ResultSet result,
int index,
CoreField field,
boolean mayShorten)
Replaces it super class method and calls
getBlobValueFromLargeObject(ResultSet, int, CoreField, boolean)
instead. |
protected Blob |
getBlobValueFromLargeObject(ResultSet result,
int index,
CoreField field,
boolean mayShorten)
Retrieves a Blob from the database using the PostgreSQL LargeObject API.
|
protected int |
getJDBCtoField(int jdbcType,
int mmbaseType)
Returns Field.TYPE_BINARY independent of the jdbcType.
|
protected void |
setBinaryValue(PreparedStatement statement,
int index,
Object objectValue,
CoreField field,
MMObjectNode node)
Writes the binary objectValue to to a LargeObject and stores the
resulting oid as long in the statement.
|
change, create, delete, getVersion, simpleCreate, tablesInheritFieldsaddToTableNameCache, appendDirectory, appendField, beginTransaction, change, change, change, change, checkFile, commit, commitChange, compareIndex, convertLegacyBinaryFiles, create, create, create, create, create, create, createIndex, createIndices, createKey, createSequence, createTable, delete, delete, delete, delete, deleteIndices, executeQuery, executeUpdate, executeUpdateCheckConnection, exists, exists, exists, exists, exists, fillNode, getBinaryFile, getBinaryValue, getBlobFromDatabase, getBlobValue, getBlobValue, getBooleanValue, getConstraintDefinition, getDateTimeValue, getFactory, getFieldDefinition, getFieldIndices, getFieldList, getFieldTypeDefinition, getInputStreamValue, getLogStartTime, getMaxLengthForKey, getNode, getNodeType, getStringValue, getStringValue, getValue, getXMLValue, init, isBinaryColumnType, isNull, isPartOfBuilderDefinition, isVerified, logQuery, readNode, refresh, releaseActiveConnection, rollback, setBooleanValue, setDateTimeValue, setDecimalValue, setListValue, setNodeType, setNodeTypeLeaveRelations, setNodeTypeRememberRelations, setNodeValue, setNullValue, setNumericValue, setStringValue, setValue, setXMLValue, shorten, size, size, storeBinaryAsFile, unloadShortedFields, useDatabaseInheritance, verify, verifyTablesprotected void delete(MMObjectNode node, MMObjectBuilder builder, List<CoreField> blobFileField, String tablename)
delete in class DatabaseStorageManagerDatabaseStorageManager.delete(MMObjectNode, MMObjectBuilder, List, String)protected void deleteLargeObjects(MMObjectNode node, MMObjectBuilder builder, List<CoreField> blobFileField)
DatabaseStorageManager.delete(MMObjectNode, MMObjectBuilder, List, String)
for the arguments.node - builder - blobFileField - protected Connection getActiveConnection() throws SQLException
getActiveConnection in class DatabaseStorageManagerSQLException - if opening the connection failedprotected Blob getBlobValue(ResultSet result, int index, CoreField field, boolean mayShorten) throws StorageException, SQLException
getBlobValueFromLargeObject(ResultSet, int, CoreField, boolean)
instead.getBlobValue in class DatabaseStorageManagerresult - the resultset to retrieve the text fromindex - the index of the text in the resultset, or -1 to retireiv from file (blobs).field - the (MMBase) fieldtype. This value can be nullnull if no binary data was storedStorageException - when data is incompatible or the function is not supportedSQLException - when a database error occursprotected Blob getBlobValueFromLargeObject(ResultSet result, int index, CoreField field, boolean mayShorten) throws StorageException, SQLException
result - ResultSet holding the current record to read.index - index of the blob field in the record set.field - Field data for the blob.mayShorten - if a Blob place holder must be returned instead of the real
blob.StorageException - when no LargeObject can be found when it should exist.SQLException - can be thrown when acquiring the LargeObjectManager fails.protected int getJDBCtoField(int jdbcType,
int mmbaseType)
getJDBCtoField in class DatabaseStorageManagerprotected void setBinaryValue(PreparedStatement statement, int index, Object objectValue, CoreField field, MMObjectNode node) throws StorageException, SQLException
setBinaryValue in class DatabaseStorageManagerstatement - the prepared statementindex - the index of the field in the prepared statementobjectValue - the data (byte array) to storefield - the MMBase field, containing meta-informationnode - the node that contains the data. Used to update this node if the database layer makes changes
to the data (i.e. creating a default value for a non-null field that had a null value)StorageException - if the data is invalid or missingSQLException - if an error occurred while filling in the fieldsMMBase 1.9-SNAPSHOT - ${javadoctimestamp}