org.mmbase.storage.database
Class HSqlStorage

java.lang.Object
  extended byorg.mmbase.module.database.support.BaseJdbc2Node
      extended byorg.mmbase.storage.database.Support2Storage
          extended byorg.mmbase.storage.database.AbstractDatabaseStorage
              extended byorg.mmbase.storage.database.SQL92DatabaseStorage
                  extended byorg.mmbase.storage.database.RelationalDatabaseStorage
                      extended byorg.mmbase.storage.database.HSqlStorage
All Implemented Interfaces:
DatabaseStorage, MMJdbc2NodeInterface, SearchQueryHandler, Storage

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

public class HSqlStorage
extends RelationalDatabaseStorage

Implements Storage in an HSql database Typical for HSql is that 'constraints' must be defined after the field definitions, and that the fieldNames must be lowercased before they are returned to MMBase.

Since:
MMBase-1.7
Version:
$Id: HSqlStorage.java,v 1.8 2004/01/27 12:04:46 pierre Exp $
Author:
Michiel Meeuwissen

Field Summary
 
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
 
Fields inherited from interface org.mmbase.storage.search.SearchQueryHandler
FEATURE_MAX_NUMBER, FEATURE_OFFSET, SUPPORT_NONE, SUPPORT_NORMAL, SUPPORT_OPTIMAL, SUPPORT_WEAK
 
Constructor Summary
HSqlStorage()
          Deprecated.  
 
Method Summary
protected  java.lang.String constructFieldDefinition(java.lang.String tableName, java.lang.String fieldName, int type, int size, int keyType)
          Deprecated. Hsql wants the constraint definition (uniuqe, primary key etc) _after_ the collumn definition, so not mixed.
protected  java.lang.String createSQL(java.lang.String tableName, java.lang.String fields, java.lang.String parentTableName, java.lang.String parentFields)
          Deprecated. Returns the SQL command to use for creating a specified table, optionally extending another supplied table.
 byte[] getDBByte(java.sql.ResultSet rs, int idx)
          Deprecated. HSql drive does not support getBlob, overridden with the 'binary stream' version
protected  java.lang.String getTableName(java.lang.String tableName)
          Deprecated. Maps the full table name to a table name acceptable to the database.
 java.lang.String mapToMMBaseFieldName(java.lang.String fieldName)
          Deprecated. Maps a database fieldname to a fieldname as used by the MMbase system
 
Methods inherited from class org.mmbase.storage.database.RelationalDatabaseStorage
commitObjectTable, commitToTable, createKey, deleteFromTable, deleteObjectTable, getText, insertIntoTable, insertObjectTable, prepare, supportsExtendedTables
 
Methods inherited from class org.mmbase.storage.database.SQL92DatabaseStorage
addField, applyCreateScheme, changeField, commit, create, created, created, createObjectStorage, delete, deleteSQL, drop, dropSQL, getBinaryFile, 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.AbstractDatabaseStorage
applyForeignKeyScheme, applyKeyScheme, applyNotNullScheme, applyPrimaryKeyScheme, applyScheme, commit, constructFieldDefinition, create, createDatabaseTransaction, createDatabaseTransaction, createKey, createObjectStorage, createSQL, createTransaction, delete, deployDatabaseReader, getBinaryFilePath, getBytes, getCreateExtendedScheme, getCreateScheme, getDBByteBinaryStream, getDBText, getFieldNameMap, getForeignKeyScheme, getFullTableName, getFullTableName, getJDBC, getKeyScheme, getMaxDropSize, getNode, getNodeType, getNotNullScheme, getNumberString, getPrimaryKeyScheme, getStoreBinaryAsFile, getTypeMap, insert, mapToTableFieldName, matchType, registerChanged, registerParentBuilder, selectSQL, selectSQL, selectSQL, setBinaryFilePath, setCreateExtendedScheme, setCreateScheme, setDBByte, setDBText, setFieldNameMap, setForeignKeyScheme, setKeyScheme, setMaxDropSize, setNotNullScheme, setPrimaryKeyScheme, setStoreBinaryAsFile, setTypeMap
 
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 org.mmbase.module.database.support.BaseJdbc2Node
getNodes, getSupportLevel, getSupportLevel, init
 
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.database.DatabaseStorage
getBinaryFilePath, getCreateExtendedScheme, getCreateScheme, getFieldNameMap, getForeignKeyScheme, getJDBC, getKeyScheme, getMaxDropSize, getNotNullScheme, getPrimaryKeyScheme, getStoreBinaryAsFile, getTypeMap, init, loadFieldFromTable, mapToTableFieldName, registerChanged, setBinaryFilePath, setCreateExtendedScheme, setCreateScheme, setFieldNameMap, setForeignKeyScheme, setKeyScheme, setMaxDropSize, setNotNullScheme, setPrimaryKeyScheme, setStoreBinaryAsFile, setTypeMap, setValuePreparedStatement
 
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.storage.search.SearchQueryHandler
getNodes, getSupportLevel, getSupportLevel
 
Methods inherited from interface org.mmbase.module.database.support.MMJdbc2NodeInterface
addField, changeField, commit, create, created, createObjectTable, decodeDBnodeField, decodeDBnodeField, drop, getAllowedField, getConnection, getDBKey, getDBText, getDisallowedField, getMMNodeSearch2SQL, getNumberString, getOTypeString, getOwnerString, getShortedByte, getShortedText, init, insert, isAllowedParentBuilder, registerParentBuilder, removeField, removeNode, setDBByte, updateTable
 

Constructor Detail

HSqlStorage

public HSqlStorage()
Deprecated. 
Method Detail

mapToMMBaseFieldName

public java.lang.String mapToMMBaseFieldName(java.lang.String fieldName)
Deprecated. 
Description copied from interface: DatabaseStorage
Maps a database fieldname to a fieldname as used by the MMbase system

Specified by:
mapToMMBaseFieldName in interface DatabaseStorage
Overrides:
mapToMMBaseFieldName in class AbstractDatabaseStorage
Parameters:
fieldName - the fieldname to map

getTableName

protected java.lang.String getTableName(java.lang.String tableName)
Deprecated. 
Description copied from class: AbstractDatabaseStorage
Maps the full table name to a table name acceptable to the database.

Overrides:
getTableName in class AbstractDatabaseStorage

constructFieldDefinition

protected java.lang.String constructFieldDefinition(java.lang.String tableName,
                                                    java.lang.String fieldName,
                                                    int type,
                                                    int size,
                                                    int keyType)
Deprecated. 
Hsql wants the constraint definition (uniuqe, primary key etc) _after_ the collumn definition, so not mixed.

Overrides:
constructFieldDefinition in class AbstractDatabaseStorage
Parameters:
tableName - name of the table this field belongs to
fieldName - name of the field in MMBase
type - MMBase type of the field
size - size of the field (or -1 if n.a.)
keyType - one of KEY_NONE, KEY_PRIMARY, KEY_SECONDARY, KEY_FOREIGN, KEY_NOTNULL
Returns:
the create definition

createSQL

protected java.lang.String createSQL(java.lang.String tableName,
                                     java.lang.String fields,
                                     java.lang.String parentTableName,
                                     java.lang.String parentFields)
Deprecated. 
Description copied from class: SQL92DatabaseStorage
Returns the SQL command to use for creating a specified table, optionally extending another supplied table. Overide this method to add a database-specific syntax or optimalization Note that the default implementation uses Ansi SQL and ignores the parentTableName parameter, instead using parentFields to complete the table creation command.

Overrides:
createSQL in class SQL92DatabaseStorage
Parameters:
tableName - the name of the table to create
fields - the definitions of the fields
parentTableName - the name of the parent table. this value is null if the table to be created has no parent table. The table is assumed to exist.
parentFields - the definitions of the fields of the parent table (for use by relational databases)
Returns:
the sql query

getDBByte

public byte[] getDBByte(java.sql.ResultSet rs,
                        int idx)
Deprecated. 
HSql drive does not support getBlob, overridden with the 'binary stream' version

Specified by:
getDBByte in interface MMJdbc2NodeInterface
Overrides:
getDBByte in class AbstractDatabaseStorage


MMBase build 1.7.1.20041002