org.mmbase.storage.database
Interface DatabaseStorage

All Superinterfaces:
SearchQueryHandler, Storage
All Known Implementing Classes:
AbstractDatabaseStorage, OODatabaseStorage, PostgreSqlStorage, RelationalDatabaseStorage, SQL92DatabaseStorage, Support2Storage

Deprecated. This code is scheduled for removal once MMBase has been fully converted to the new StorageManager implementation.

public interface DatabaseStorage
extends Storage

Storage interface for use with a database. This interface adds two type of methods. The first are methods used to configure the database, or to store the current configuration, either by using a Document or through seperate calls. The second methods are used as callback methods by a DatabaseTransaction object, to handle specific database dependent routines, such as storing binary objects.

Since:
MMBase-1.6
Version:
$Id: DatabaseStorage.java,v 1.6 2004/01/27 12:04:46 pierre Exp $
Author:
Pierre van Rooden

Field Summary
static int KEY_FOREIGN
          Deprecated. Indicates a field is a foreign key
static int KEY_NONE
          Deprecated. Indicates a field is not a key, and nullable
static int KEY_NOTNULL
          Deprecated. Indicates a field is not a key, and not nullable
static int KEY_PRIMARY
          Deprecated. Indicates a field is a primary key
static int KEY_SECONDARY
          Deprecated. Indicates a field is a unique secondary key
 
Fields inherited from interface org.mmbase.storage.search.SearchQueryHandler
FEATURE_MAX_NUMBER, FEATURE_OFFSET, SUPPORT_NONE, SUPPORT_NORMAL, SUPPORT_OPTIMAL, SUPPORT_WEAK
 
Method Summary
 java.io.File getBinaryFilePath()
          Deprecated. Returns the filepath where binary objects are stored.
 java.lang.String getCreateExtendedScheme()
          Deprecated. Returns the scheme (SQL command) to use for creating a table that extends another table
 java.lang.String getCreateScheme()
          Deprecated. Returns the scheme (SQL command) to use for creating a table
 java.util.Map getFieldNameMap()
          Deprecated. Returns the current mapping of disallowed fieldsnames (typically reserved words) and their replacement names.
 java.lang.String getForeignKeyScheme()
          Deprecated. Returns the scheme (SQL command) to use for creating a key
 JDBCInterface getJDBC()
          Deprecated. Returns the JDBC module used by this class to connect to the database.
 java.lang.String getKeyScheme()
          Deprecated. Returns the scheme (SQL command) to use for creating a key
 int getMaxDropSize()
          Deprecated. Returns the maximum table drop size.
 java.lang.String getNotNullScheme()
          Deprecated. Returns the scheme (SQL command) to use for creating a non-null field
 java.lang.String getPrimaryKeyScheme()
          Deprecated. Returns the scheme (SQL command) to use for creating a primary key
 boolean getStoreBinaryAsFile()
          Deprecated. Returns whether binary objects are stored as files (rather than in the database)
 java.util.Map getTypeMap()
          Deprecated. Obtains the type map.
 void init(MMBase mmb, XMLDatabaseReader reader)
          Deprecated. Initializes the database layer.
 void loadFieldFromTable(MMObjectNode node, java.lang.String fieldName, java.sql.ResultSet rs, int i)
          Deprecated. Stores a field in a table ResultSet in a MMObjectNode.
 java.lang.String mapToMMBaseFieldName(java.lang.String fieldName)
          Deprecated. Maps a database fieldname to a fieldname as used by the MMbase system
 java.lang.String mapToTableFieldName(java.lang.String fieldName)
          Deprecated. Maps a MMBase fieldname to a fieldname acceptable to the database
 void registerChanged(MMObjectNode node, java.lang.String change)
          Deprecated. Registers the change to a node.
 void setBinaryFilePath(java.io.File path)
          Deprecated. Sets the filepath where binary objects are stored.
 void setCreateExtendedScheme(java.lang.String scheme)
          Deprecated. Sets the scheme (SQL command) to use for creating a table that extends another table
 void setCreateScheme(java.lang.String scheme)
          Deprecated. Sets the scheme (SQL command) to use for creating a table
 void setFieldNameMap(java.util.Map fieldmap)
          Deprecated. Sets the mapping of MMBase fieldnames (typically reserved words) to database fieldnames.
 void setForeignKeyScheme(java.lang.String scheme)
          Deprecated. Sets the scheme (SQL command) to use for creating a key
 void setKeyScheme(java.lang.String scheme)
          Deprecated. Sets the scheme (SQL command) to use for creating a key
 void setMaxDropSize(int value)
          Deprecated. Sets the maximum table drop size.
 void setNotNullScheme(java.lang.String scheme)
          Deprecated. Sets the scheme (SQL command) to use for creating a non-null field
 void setPrimaryKeyScheme(java.lang.String scheme)
          Deprecated. Sets the scheme (SQL command) to use for creating a primary key
 void setStoreBinaryAsFile(boolean value)
          Deprecated. Sets whether binary objects are stored as files (rather than in the database)
 void setTypeMap(java.util.Map typeMap)
          Deprecated. Sets the type map.
 boolean setValuePreparedStatement(java.sql.PreparedStatement stmt, MMObjectNode node, java.lang.String key, int i)
          Deprecated. Set prepared statement field i with value of key from node
 boolean supportsExtendedTables()
          Deprecated. Returns whether this storage layer supports extended tables.
 
Methods inherited from interface org.mmbase.storage.Storage
addField, changeField, commit, commit, create, create, created, createKey, 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.storage.search.SearchQueryHandler
getNodes, getSupportLevel, getSupportLevel
 

Field Detail

KEY_NONE

public static final int KEY_NONE
Deprecated. 
Indicates a field is not a key, and nullable

See Also:
Constant Field Values

KEY_PRIMARY

public static final int KEY_PRIMARY
Deprecated. 
Indicates a field is a primary key

See Also:
Constant Field Values

KEY_SECONDARY

public static final int KEY_SECONDARY
Deprecated. 
Indicates a field is a unique secondary key

See Also:
Constant Field Values

KEY_FOREIGN

public static final int KEY_FOREIGN
Deprecated. 
Indicates a field is a foreign key

See Also:
Constant Field Values

KEY_NOTNULL

public static final int KEY_NOTNULL
Deprecated. 
Indicates a field is not a key, and not nullable

See Also:
Constant Field Values
Method Detail

init

public void init(MMBase mmb,
                 XMLDatabaseReader reader)
Deprecated. 
Initializes the database layer. This reads database specific content from the database configuration document. If needed, the code creates a 'numbertable' for mmbase to track number generation.

Parameters:
mmb - the MBase instance that uses this database layer
reader - the database configuration reader

getStoreBinaryAsFile

public boolean getStoreBinaryAsFile()
Deprecated. 
Returns whether binary objects are stored as files (rather than in the database)

Returns:
true if binary objects are stored as files

setStoreBinaryAsFile

public void setStoreBinaryAsFile(boolean value)
Deprecated. 
Sets whether binary objects are stored as files (rather than in the database)

Parameters:
value - if true, binary objects will be stored as files

getBinaryFilePath

public java.io.File getBinaryFilePath()
Deprecated. 
Returns the filepath where binary objects are stored. Only applies if getStoreBinaryAsFile() returns true.

Returns:
the file path

setBinaryFilePath

public void setBinaryFilePath(java.io.File path)
Deprecated. 
Sets the filepath where binary objects are stored. Only applies if getStoreBinaryAsFile() returns true.

Parameters:
path - the file path

setFieldNameMap

public void setFieldNameMap(java.util.Map fieldmap)
Deprecated. 
Sets the mapping of MMBase fieldnames (typically reserved words) to database fieldnames. This map is used to map MMBase fieldnames to fieldnames that are acceptable to the database, i.e. Oracle does not accept 'number' as a fieldname, though MMBase uses it as a field name.

Parameters:
fieldmap - Map of field mappings. The map contins a key value pairs where the key is the MMbase fieldname, and the value the replacement acceptable to the database.

getFieldNameMap

public java.util.Map getFieldNameMap()
Deprecated. 
Returns the current mapping of disallowed fieldsnames (typically reserved words) and their replacement names. Note that this is a copy. Changes made to this map will not affect the databse until set with setFieldNameMap(java.util.Map).

Returns:
a Map of field mappings.

setTypeMap

public void setTypeMap(java.util.Map typeMap)
Deprecated. 
Sets the type map. The type map is used to convert MMBase types to database types (needed for creating tables).


getTypeMap

public java.util.Map getTypeMap()
Deprecated. 
Obtains the type map. The type map is used to convert MMBase types to database types (needed for creating tables). Note that this is a copy. Changes made to this map will not affect the database until set with setTypeMap(java.util.Map). However, the individual map elements are not copies - changing the dTypeInfo objects wil affect the database layer directly.

Returns:
a Map of MMBase types and their database type.

setPrimaryKeyScheme

public void setPrimaryKeyScheme(java.lang.String scheme)
Deprecated. 
Sets the scheme (SQL command) to use for creating a primary key

Parameters:
scheme - the scheme to use

getPrimaryKeyScheme

public java.lang.String getPrimaryKeyScheme()
Deprecated. 
Returns the scheme (SQL command) to use for creating a primary key


setNotNullScheme

public void setNotNullScheme(java.lang.String scheme)
Deprecated. 
Sets the scheme (SQL command) to use for creating a non-null field

Parameters:
scheme - the scheme to use

getNotNullScheme

public java.lang.String getNotNullScheme()
Deprecated. 
Returns the scheme (SQL command) to use for creating a non-null field


setKeyScheme

public void setKeyScheme(java.lang.String scheme)
Deprecated. 
Sets the scheme (SQL command) to use for creating a key

Parameters:
scheme - the scheme to use

getKeyScheme

public java.lang.String getKeyScheme()
Deprecated. 
Returns the scheme (SQL command) to use for creating a key


setForeignKeyScheme

public void setForeignKeyScheme(java.lang.String scheme)
Deprecated. 
Sets the scheme (SQL command) to use for creating a key

Parameters:
scheme - the scheme to use

getForeignKeyScheme

public java.lang.String getForeignKeyScheme()
Deprecated. 
Returns the scheme (SQL command) to use for creating a key


setCreateScheme

public void setCreateScheme(java.lang.String scheme)
Deprecated. 
Sets the scheme (SQL command) to use for creating a table

Parameters:
scheme - the scheme to use

getCreateScheme

public java.lang.String getCreateScheme()
Deprecated. 
Returns the scheme (SQL command) to use for creating a table


setCreateExtendedScheme

public void setCreateExtendedScheme(java.lang.String scheme)
Deprecated. 
Sets the scheme (SQL command) to use for creating a table that extends another table

Parameters:
scheme - the scheme to use

getCreateExtendedScheme

public java.lang.String getCreateExtendedScheme()
Deprecated. 
Returns the scheme (SQL command) to use for creating a table that extends another table


setMaxDropSize

public void setMaxDropSize(int value)
Deprecated. 
Sets the maximum table drop size.

Parameters:
value - the maximum size to set

getMaxDropSize

public int getMaxDropSize()
Deprecated. 
Returns the maximum table drop size.


supportsExtendedTables

public boolean supportsExtendedTables()
Deprecated. 
Returns whether this storage layer supports extended tables.

Returns:
boolean true if extended tables are supported

mapToTableFieldName

public java.lang.String mapToTableFieldName(java.lang.String fieldName)
Deprecated. 
Maps a MMBase fieldname to a fieldname acceptable to the database


mapToMMBaseFieldName

public java.lang.String mapToMMBaseFieldName(java.lang.String fieldName)
Deprecated. 
Maps a database fieldname to a fieldname as used by the MMbase system


getJDBC

public JDBCInterface getJDBC()
Deprecated. 
Returns the JDBC module used by this class to connect to the database. Note that this interface may be up to change, so use with care.

Returns:
the JDBC Module.

loadFieldFromTable

public void loadFieldFromTable(MMObjectNode node,
                               java.lang.String fieldName,
                               java.sql.ResultSet rs,
                               int i)
Deprecated. 
Stores a field in a table ResultSet in a MMObjectNode.

Parameters:
node - the node to store the field in
rs - the ResultSet containing the table row
i - the index of the field in the ResultSet

setValuePreparedStatement

public boolean setValuePreparedStatement(java.sql.PreparedStatement stmt,
                                         MMObjectNode node,
                                         java.lang.String key,
                                         int i)
                                  throws java.sql.SQLException
Deprecated. 
Set prepared statement field i with value of key from node

Throws:
java.sql.SQLException - if an error occurred while filling in the fields
Warning: No Java Documentation Available.

registerChanged

public void registerChanged(MMObjectNode node,
                            java.lang.String change)
Deprecated. 
Registers the change to a node. Clears the change status of a ndoe, then broadcasts changes to the node's parent builder. If the node is a relation, it also updates the relationcache and broadcasts these changes to the relation' s source and destination.

Parameters:
node - the node to register
change - the type of change: "n": new, "c": commit, "d": delete
To Do:
should pass Transaction!


MMBase build 1.7.1.20041002