|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.mmbase.storage.implementation.database.DatabaseStorageManager
org.mmbase.storage.implementation.database.RelationalDatabaseStorageManager
org.mmbase.storage.implementation.database.PostgresqlLargeObjectStorageManager
public class PostgresqlLargeObjectStorageManager
This class is responsible for handling binary objects using the PostgreSQL LargeObject API.
| Nested Class Summary |
|---|
| Nested classes/interfaces inherited from class org.mmbase.storage.implementation.database.DatabaseStorageManager |
|---|
DatabaseStorageManager.InputStreamBlob |
| Field Summary |
|---|
| Fields inherited from class org.mmbase.storage.implementation.database.DatabaseStorageManager |
|---|
activeConnection, changes, factory, inTransaction, OBJ2TYPE_MAX_SIZE, sequenceKeys, transactionIsolation, typeCache |
| Constructor Summary | |
|---|---|
PostgresqlLargeObjectStorageManager()
|
|
| Method Summary | |
|---|---|
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. |
| Methods inherited from class org.mmbase.storage.implementation.database.RelationalDatabaseStorageManager |
|---|
change, create, delete, getVersion, simpleCreate, tablesInheritFields |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public PostgresqlLargeObjectStorageManager()
| Method Detail |
|---|
protected 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 failed
protected 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 null
null if no binary data was stored
StorageException - when data is incompatible or the function is not supported
SQLException - when a database error occurs
protected 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 DatabaseStorageManager
protected 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 missing
SQLException - if an error occurred while filling in the fields
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||