|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||
java.lang.Object
|
+--org.mmbase.storage.database.Support2Storage
|
+--org.mmbase.storage.database.AbstractDatabaseStorage
|
+--org.mmbase.storage.database.SQL92DatabaseStorage
|
+--org.mmbase.storage.database.RelationalDatabaseStorage
RelationalDatabaseStorage implements the DatabaseStorage interface and the MMJdbc2NodeInterface for Ansi SQL 92 relational databases. This class extends AbstractDatabaseStorage to include methods for retrieving data from a relational database systems. It overrides the various update methods to allow for recursive updates on parent tables, the methods for storing and retrieving huge texts and bytefields, and teh methods for determining database key (for the object 'number' field).
| Fields inherited from class org.mmbase.storage.database.AbstractDatabaseStorage |
mmb |
| Fields inherited from interface org.mmbase.storage.database.DatabaseStorage |
KEY_FOREIGN, KEY_NONE, KEY_NOTNULL, KEY_PRIMARY, KEY_SECONDARY |
| Constructor Summary | |
RelationalDatabaseStorage()
Constructs the Ansi SQL database layer support class |
|
| Method Summary | |
protected boolean |
commitObjectTable(MMObjectNode node,
DatabaseTransaction trans)
Commit this node to the object table. |
boolean |
commitToTable(MMObjectBuilder builder,
MMObjectNode node,
DatabaseTransaction trans)
Commit this node to the specified builder table. |
int |
createKey(Transaction trans)
Gives an unique number for a node to be inserted. |
boolean |
deleteFromTable(MMObjectBuilder builder,
MMObjectNode node,
DatabaseTransaction trans)
Remove a node from the specified builder table. |
protected boolean |
deleteObjectTable(MMObjectNode node,
DatabaseTransaction trans)
Remove a node from the object table. |
byte[] |
getBytes(java.lang.String tableName,
java.lang.String fieldname,
int number)
Get byte of a database blob |
byte[] |
getDBByte(java.sql.ResultSet rs,
int idx)
Get byte of a database blob |
java.lang.String |
getDBText(java.sql.ResultSet rs,
int idx)
Get text of a database blob |
java.lang.String |
getText(java.lang.String tableName,
java.lang.String fieldname,
int number)
Get text from blob |
int |
insertIntoTable(MMObjectBuilder builder,
MMObjectNode node,
DatabaseTransaction trans)
This method inserts a new object in a specified builder table. |
protected int |
insertObjectTable(MMObjectNode node,
DatabaseTransaction trans)
This method inserts a new object in the object table. |
protected void |
prepare()
Prepares the database layer. |
void |
setDBByte(int i,
java.sql.PreparedStatement stmt,
byte[] bytes)
Set byte array in database |
void |
setDBText(int i,
java.sql.PreparedStatement stmt,
java.lang.String body)
Set text array in database |
boolean |
supportsExtendedTables()
Returns whether this storage layer supports extended tables. |
| Methods inherited from class org.mmbase.storage.database.SQL92DatabaseStorage |
addField, applyCreateScheme, changeField, commit, create, created, created, createObjectStorage, createSQL, delete, deleteSQL, drop, dropSQL, getBytes, getFieldsOrderCreate, getNode, getNodeType, getParentBuilder, getParentTableName, getText, init, insert, insertSQL, isAllowedParentBuilder, isParentField, loadExistingTables, loadFieldFromTable, loadSupportInformation, readBytesFromFile, removeField, selectSQL, setValuePreparedStatement, size, size, supportsRollback, updateSQL, updateStorage, writeBytesToFile |
| Methods inherited from class org.mmbase.storage.database.Support2Storage |
commit, createObjectTable, decodeDBnodeField, decodeDBnodeField, getAllowedField, getConnection, getDBKey, getDisallowedField, getMMNodeSearch2SQL, getOTypeString, getOwnerString, getShortedByte, getShortedText, insert, removeNode, updateTable |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.mmbase.storage.Storage |
addField, changeField, commit, commit, create, create, created, createKey, createObjectStorage, createObjectStorage, createTransaction, delete, delete, drop, getBytes, getNode, getNode, getNodeType, getNodeType, getText, insert, insert, isAllowedParentBuilder, registerParentBuilder, removeField, size, supportsRollback, updateStorage |
| Methods inherited from interface org.mmbase.module.database.support.MMJdbc2NodeInterface |
addField, changeField, commit, create, created, createObjectTable, decodeDBnodeField, decodeDBnodeField, drop, getAllowedField, getConnection, getDBKey, getDisallowedField, getMMNodeSearch2SQL, getNumberString, getOTypeString, getOwnerString, getShortedByte, getShortedText, init, insert, isAllowedParentBuilder, registerParentBuilder, removeField, removeNode, updateTable |
| Constructor Detail |
public RelationalDatabaseStorage()
| Method Detail |
protected void prepare()
createKey(org.mmbase.storage.Transaction) method.
Override this method if you use a different way of generating keys,
or if you need to make other preparations for your database.prepare in class SQL92DatabaseStoragepublic boolean supportsExtendedTables()
supportsExtendedTables in interface DatabaseStoragesupportsExtendedTables in class SQL92DatabaseStorage
public java.lang.String getText(java.lang.String tableName,
java.lang.String fieldname,
int number)
getText in class SQL92DatabaseStorage
public byte[] getBytes(java.lang.String tableName,
java.lang.String fieldname,
int number)
getBytes in class SQL92DatabaseStorage
public byte[] getDBByte(java.sql.ResultSet rs,
int idx)
getDBByte in interface MMJdbc2NodeInterfacegetDBByte in class Support2Storage
public java.lang.String getDBText(java.sql.ResultSet rs,
int idx)
getDBText in interface MMJdbc2NodeInterfacegetDBText in class Support2Storage
public void setDBText(int i,
java.sql.PreparedStatement stmt,
java.lang.String body)
setDBText in class AbstractDatabaseStorage
public void setDBByte(int i,
java.sql.PreparedStatement stmt,
byte[] bytes)
setDBByte in interface MMJdbc2NodeInterfacesetDBByte in class AbstractDatabaseStorage
public int createKey(Transaction trans)
throws StorageException
createKey in interface StoragecreateKey in class AbstractDatabaseStoragetrans - the transaction to use for obtaining the keyStorageException - if an error occurred while obtaining the key
public int insertIntoTable(MMObjectBuilder builder,
MMObjectNode node,
DatabaseTransaction trans)
throws StorageException
insertIntoTable in class SQL92DatabaseStoragebuilder - the builder to store teh node in. This can be a parentbuilder of the node's actual buildernode - The node to inserttrans - the transaction to perform the insert inStorageException - if an error occurred during insert
protected int insertObjectTable(MMObjectNode node,
DatabaseTransaction trans)
throws StorageException
SQL92DatabaseStorage.insert(org.mmbase.module.core.MMObjectNode, org.mmbase.storage.Transaction) to maintain consistency.node - The node to inserttrans - the transaction to perform the insert inStorageException - if an error occurred during insert
public boolean commitToTable(MMObjectBuilder builder,
MMObjectNode node,
DatabaseTransaction trans)
throws StorageException
commitToTable in class SQL92DatabaseStoragebuilder - the builder to commit the node to. This can be a parentbuilder of the node's actual buildernode - The node to inserttrans - the transaction to perform the insert inStorageException - if an error occurred during commit
protected boolean commitObjectTable(MMObjectNode node,
DatabaseTransaction trans)
throws StorageException
node - The node to inserttrans - the transaction to perform the insert inStorageException - if an error occurred during commit
public boolean deleteFromTable(MMObjectBuilder builder,
MMObjectNode node,
DatabaseTransaction trans)
throws StorageException
deleteFromTable in class SQL92DatabaseStoragebuilder - the builder to remove the node from. This can be a parentbuilder of the node's actual buildernode - The node to deletetrans - the transaction to perform the insert inStorageException - if an error occurred during delete
protected boolean deleteObjectTable(MMObjectNode node,
DatabaseTransaction trans)
throws StorageException
node - The node to deletetrans - the transaction to perform the insert inStorageException - if an error occurred during delete
|
||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
| SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||