org.mmbase.module.database.support
Class MMSQL92Node

java.lang.Object
  extended byorg.mmbase.module.database.support.BaseJdbc2Node
      extended byorg.mmbase.module.database.support.MMSQL92Node
All Implemented Interfaces:
MMJdbc2NodeInterface, SearchQueryHandler
Direct Known Subclasses:
MMHsqldb2Node, MMHypersonic2Node, MMInformix42Node, MMMysql42Node, MMOORel2Node, MMOracle, MMPostgres42Node

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

public class MMSQL92Node
extends BaseJdbc2Node
implements MMJdbc2NodeInterface

MMSQL92Node implements the MMJdbc2NodeInterface for sql92 types of database this is the class used to abstact the query's needed for mmbase for each database.

Version:
$Id: MMSQL92Node.java,v 1.81.2.1 2004/06/15 21:38:34 robmaris Exp $
Author:
Daniel Ockeloen, Pierre van Rooden, Kees Jongenburger

Field Summary
protected  java.util.Hashtable allowed2disallowed
          Deprecated.  
protected  java.util.Hashtable disallowed2allowed
          Deprecated.  
protected  MMBase mmb
          Deprecated.  
 java.lang.String name
          Deprecated.  
protected  XMLDatabaseReader parser
          Deprecated.  
protected  java.util.Hashtable typeMapping
          Deprecated.  
 
Fields inherited from interface org.mmbase.storage.search.SearchQueryHandler
FEATURE_MAX_NUMBER, FEATURE_OFFSET, SUPPORT_NONE, SUPPORT_NORMAL, SUPPORT_OPTIMAL, SUPPORT_WEAK
 
Constructor Summary
MMSQL92Node()
          Deprecated.  
 
Method Summary
 boolean addField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
 boolean changeField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
 boolean commit(MMObjectBuilder bul, MMObjectNode node)
          Deprecated. Commit this node to the database
 java.lang.String convertXMLType(FieldDefs def)
          Deprecated.  
 boolean create_real(MMObjectBuilder bul, java.lang.String tableName)
          Deprecated. Will be removed once the xml setup system is done (?)
 boolean create(MMObjectBuilder bul)
          Deprecated.  
 boolean created(java.lang.String tableName)
          Deprecated. Tells if a table already exists
 boolean createObjectTable(java.lang.String baseName)
          Deprecated.  
 MMObjectNode decodeDBnodeField(MMObjectNode node, java.lang.String fieldname, java.sql.ResultSet rs, int i)
          Deprecated. Sets the value of the field with name 'fieldName' in the node.
 MMObjectNode decodeDBnodeField(MMObjectNode node, java.lang.String fieldname, java.sql.ResultSet rs, int i, java.lang.String prefix)
          Deprecated.  
protected  java.lang.String decodeStringField(java.sql.ResultSet rs, int i)
          Deprecated. Some Database implementations want to fake encoding, and can override this function.
 boolean drop_real(MMObjectBuilder bul, java.lang.String tableName)
          Deprecated. Will be removed once the xml setup system is done (?)
 boolean drop(MMObjectBuilder bul)
          Deprecated.  
 java.lang.String getAllowedField(java.lang.String disallowedfield)
          Deprecated.  
 MultiConnection getConnection(JDBCInterface jdbc)
          Deprecated.  
 byte[] getDBByte(java.sql.ResultSet rs, int idx)
          Deprecated. Get byte of a database blob
 int getDBKey()
          Deprecated. Gives an unique number for a node to be inserted.
protected  int getDBKeyOld()
          Deprecated. Can be replaced by '1'. Because new installations create the the numberTable when there are not objects yet.
 java.lang.String getDBText(java.sql.ResultSet rs, int idx)
          Deprecated. Get text of a database blob
 java.lang.String getDisallowedField(java.lang.String allowedfield)
          Deprecated.  
 java.lang.String getMatchCREATE(java.lang.String tableName)
          Deprecated. gets the sytax of the create statement for current database.
 java.lang.String getMMNodeSearch2SQL(java.lang.String where, MMObjectBuilder bul)
          Deprecated. Converts an MMNODE expression to an SQL expression.
 java.lang.String getNumberString()
          Deprecated.  
 java.lang.String getOTypeString()
          Deprecated.  
 java.lang.String getOwnerString()
          Deprecated.  
 java.util.Hashtable getReverseHash(java.util.Hashtable in)
          Deprecated.  
 byte[] getShortedByte(java.lang.String tableName, java.lang.String fieldname, int number)
          Deprecated. Get byte of a database blob
 java.lang.String getShortedText(java.lang.String tableName, java.lang.String fieldname, int number)
          Deprecated. Get text from blob
 void init(MMBase mmb, XMLDatabaseReader parser)
          Deprecated.  
 int insert_real(MMObjectBuilder bul, java.lang.String owner, MMObjectNode node, java.lang.String tableName)
          Deprecated.  
 int insert(MMObjectBuilder bul, java.lang.String owner, MMObjectNode node)
          Deprecated. Insert: This method inserts a new object, normally not used (only subtables are used) Only fields with DBState value = DBSTATE_PERSISTENT or DBSTATE_SYSTEM are inserted.
 boolean isAllowedParentBuilder(MMObjectBuilder builder)
          Deprecated. Returns whether this database support layer allows for buidler to be a parent builder (that is, other builders can 'extend' this builder and its database tables).
protected  java.lang.String matchType(int type, int size, boolean notnull)
          Deprecated.  
 java.lang.String parseFieldPart(java.lang.String fieldname, int dbtype, java.lang.String part)
          Deprecated.  
 void registerParentBuilder(MMObjectBuilder parent, MMObjectBuilder child)
          Deprecated. Registers a builder as a parent builder (that is, other buidlers can 'extend' this builder and its database tables).
 boolean removeField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
 void removeNode(MMObjectBuilder bul, MMObjectNode node)
          Deprecated. removeNode
 void setDBByte(int i, java.sql.PreparedStatement stmt, byte[] bytes)
          Deprecated. Set byte array in database
 void setDBText(int i, java.sql.PreparedStatement stmt, java.lang.String body)
          Deprecated. Set text array in database
 int size(java.lang.String tableName)
          Deprecated. Return number of entries consisting in given table
 boolean tableSizeProtection(MMObjectBuilder bul)
          Deprecated.  
 boolean updateTable(MMObjectBuilder bul)
          Deprecated.  
 
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.search.SearchQueryHandler
getNodes, getSupportLevel, getSupportLevel
 

Field Detail

name

public java.lang.String name
Deprecated. 
Warning: Scope will be changed to:
private
Warning: No Java Documentation Available.

parser

protected XMLDatabaseReader parser
Deprecated. 
Warning: Scope will be changed to:
private
Warning: No Java Documentation Available.

typeMapping

protected java.util.Hashtable typeMapping
Deprecated. 
Warning: Scope will be changed to:
private
Warning: No Java Documentation Available.

disallowed2allowed

protected java.util.Hashtable disallowed2allowed
Deprecated. 
Warning: Scope will be changed to:
private
Warning: No Java Documentation Available.

allowed2disallowed

protected java.util.Hashtable allowed2disallowed
Deprecated. 
Warning: Scope will be changed to:
private
Warning: No Java Documentation Available.

mmb

protected MMBase mmb
Deprecated. 
Warning: Scope will be changed to:
private
Warning: No Java Documentation Available.
Constructor Detail

MMSQL92Node

public MMSQL92Node()
Deprecated. 
Method Detail

init

public void init(MMBase mmb,
                 XMLDatabaseReader parser)
Deprecated. 
Specified by:
init in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

decodeDBnodeField

public MMObjectNode decodeDBnodeField(MMObjectNode node,
                                      java.lang.String fieldname,
                                      java.sql.ResultSet rs,
                                      int i)
Deprecated. 
Description copied from interface: MMJdbc2NodeInterface
Sets the value of the field with name 'fieldName' in the node. Using the given database result set. The value of the field will be taken from the i-th collumn of the result set. Note: This method may attempt to map the provided 'database' fieldname to the MMBase name. In very specific cases, this may not have the desired result.

Specified by:
decodeDBnodeField in interface MMJdbc2NodeInterface
Parameters:
node - The node from which a field must be set
fieldname - The name of the field which must be set. This is expected to be the field as used by the database, not the field as used by MMBase.
rs - The resultset from which the value of the field must be obtained
i - The integer indicating from which position the value must be gotten from the resultSet record.
Warning: No Java Documentation Available.

isAllowedParentBuilder

public boolean isAllowedParentBuilder(MMObjectBuilder builder)
Deprecated. 
Returns whether this database support layer allows for buidler to be a parent builder (that is, other builders can 'extend' this builder and its database tables).

Specified by:
isAllowedParentBuilder in interface MMJdbc2NodeInterface
Parameters:
builder - the builder to test
Returns:
true if the builder can be extended
Since:
MMBase-1.6

registerParentBuilder

public void registerParentBuilder(MMObjectBuilder parent,
                                  MMObjectBuilder child)
                           throws UnsupportedDatabaseOperationException
Deprecated. 
Registers a builder as a parent builder (that is, other buidlers can 'extend' this builder and its database tables). At the least, this code should check whether the builder is allowed as a parent builder, and throw an exception if this is not possible. This method can be overridden to allow for optimization of code regarding such builders.

Specified by:
registerParentBuilder in interface MMJdbc2NodeInterface
Parameters:
parent - the parent builder to register
child - the builder to register as the parent's child
Throws:
UnsupportedDatabaseOperationException - when the databse layer does not allow extension of this builder
Since:
MMBase-1.6

decodeStringField

protected java.lang.String decodeStringField(java.sql.ResultSet rs,
                                             int i)
                                      throws java.sql.SQLException
Deprecated. 
Some Database implementations want to fake encoding, and can override this function.

Throws:
java.sql.SQLException
Since:
MMBase-1.6

decodeDBnodeField

public MMObjectNode decodeDBnodeField(MMObjectNode node,
                                      java.lang.String fieldname,
                                      java.sql.ResultSet rs,
                                      int i,
                                      java.lang.String prefix)
Deprecated. 
Specified by:
decodeDBnodeField in interface MMJdbc2NodeInterface
Parameters:
prefix - When using cluster nodes, the key of the value map of the node must be prefixed (e.g. with 'news.')
See Also:
MMJdbc2NodeInterface.decodeDBnodeField(MMObjectNode, String, ResultSet, int)
Warning: No Java Documentation Available.

getMMNodeSearch2SQL

public java.lang.String getMMNodeSearch2SQL(java.lang.String where,
                                            MMObjectBuilder bul)
Deprecated. 
Description copied from interface: MMJdbc2NodeInterface
Converts an MMNODE expression to an SQL expression. Returns the result as an SQL where-clause, but with the leading "WHERE " left out.

Specified by:
getMMNodeSearch2SQL in interface MMJdbc2NodeInterface
Parameters:
where - The MMNODE expression.
bul - The builder for the type of nodes that is queried.
Returns:
The SQL expression.
See Also:
MMObjectBuilder.convertMMNode2SQL(String)
Warning: No Java Documentation Available.

parseFieldPart

public java.lang.String parseFieldPart(java.lang.String fieldname,
                                       int dbtype,
                                       java.lang.String part)
Deprecated. 
Warning: No Java Documentation Available.

getShortedText

public java.lang.String getShortedText(java.lang.String tableName,
                                       java.lang.String fieldname,
                                       int number)
Deprecated. 
Get text from blob

Specified by:
getShortedText in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

getShortedByte

public byte[] getShortedByte(java.lang.String tableName,
                             java.lang.String fieldname,
                             int number)
Deprecated. 
Get byte of a database blob

Specified by:
getShortedByte in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

getDBByte

public byte[] getDBByte(java.sql.ResultSet rs,
                        int idx)
Deprecated. 
Get byte of a database blob

Specified by:
getDBByte in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

getDBText

public java.lang.String getDBText(java.sql.ResultSet rs,
                                  int idx)
Deprecated. 
Get text of a database blob

Specified by:
getDBText in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

insert

public int insert(MMObjectBuilder bul,
                  java.lang.String owner,
                  MMObjectNode node)
Deprecated. 
Insert: This method inserts a new object, normally not used (only subtables are used) Only fields with DBState value = DBSTATE_PERSISTENT or DBSTATE_SYSTEM are inserted. Fields with DBstate values = DBSTATE_VIRTUAL or any other value are skipped.

Specified by:
insert in interface MMJdbc2NodeInterface
Parameters:
bul - The MMObjectBuilder.
owner - The nodes' owner.
node - The current node that's to be inserted.
Returns:
The DBKey number for this node, or -1 if an error occurs.

insert_real

public int insert_real(MMObjectBuilder bul,
                       java.lang.String owner,
                       MMObjectNode node,
                       java.lang.String tableName)
Deprecated. 
Warning: No Java Documentation Available.

setDBText

public void setDBText(int i,
                      java.sql.PreparedStatement stmt,
                      java.lang.String body)
Deprecated. 
Set text array in database

Warning: No Java Documentation Available.

setDBByte

public void setDBByte(int i,
                      java.sql.PreparedStatement stmt,
                      byte[] bytes)
Deprecated. 
Set byte array in database

Specified by:
setDBByte in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

commit

public boolean commit(MMObjectBuilder bul,
                      MMObjectNode node)
Deprecated. 
Commit this node to the database

Specified by:
commit in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

removeNode

public void removeNode(MMObjectBuilder bul,
                       MMObjectNode node)
Deprecated. 
removeNode

Specified by:
removeNode in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

getDBKey

public int getDBKey()
Deprecated. 
Gives an unique number for a node to be inserted. This method will work with multiple mmbases

Specified by:
getDBKey in interface MMJdbc2NodeInterface
Returns:
unique number

getDBKeyOld

protected int getDBKeyOld()
Deprecated. Can be replaced by '1'. Because new installations create the the numberTable when there are not objects yet.

Get a new object key without using numberTable, that is, by getting the max number of mm_object. If object table does not exist (yet), it returns 1. This is only used when creating the numberTable.


created

public boolean created(java.lang.String tableName)
Deprecated. 
Tells if a table already exists

Specified by:
created in interface MMJdbc2NodeInterface
Returns:
true if table exists, false if table doesn't exists

size

public int size(java.lang.String tableName)
Deprecated. 
Return number of entries consisting in given table

Parameters:
tableName - the table that has to be counted
Returns:
the number of items the table has

create

public boolean create(MMObjectBuilder bul)
Deprecated. 
Specified by:
create in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

create_real

public boolean create_real(MMObjectBuilder bul,
                           java.lang.String tableName)
Deprecated. 
Will be removed once the xml setup system is done (?)

Warning: No Java Documentation Available.
Warning: Contains Duplicate Code (present in other classes)
move to create()

drop

public boolean drop(MMObjectBuilder bul)
Deprecated. 
Specified by:
drop in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

drop_real

public boolean drop_real(MMObjectBuilder bul,
                         java.lang.String tableName)
Deprecated. 
Will be removed once the xml setup system is done (?)

Warning: No Java Documentation Available.
Warning: Contains Duplicate Code (present in other classes)
move to create()

addField

public boolean addField(MMObjectBuilder bul,
                        java.lang.String fieldname)
Deprecated. 
Specified by:
addField in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

removeField

public boolean removeField(MMObjectBuilder bul,
                           java.lang.String fieldname)
Deprecated. 
Specified by:
removeField in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

changeField

public boolean changeField(MMObjectBuilder bul,
                           java.lang.String fieldname)
Deprecated. 
Specified by:
changeField in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

updateTable

public boolean updateTable(MMObjectBuilder bul)
Deprecated. 
Specified by:
updateTable in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

createObjectTable

public boolean createObjectTable(java.lang.String baseName)
Deprecated. 
Specified by:
createObjectTable in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

convertXMLType

public java.lang.String convertXMLType(FieldDefs def)
Deprecated. 
Warning: No Java Documentation Available.

matchType

protected java.lang.String matchType(int type,
                                     int size,
                                     boolean notnull)
Deprecated. 
Warning: No Java Documentation Available.

getMatchCREATE

public java.lang.String getMatchCREATE(java.lang.String tableName)
Deprecated. 
gets the sytax of the create statement for current database.

Warning: No Java Documentation Available.

getReverseHash

public java.util.Hashtable getReverseHash(java.util.Hashtable in)
Deprecated. 
Warning: No Java Documentation Available.

getDisallowedField

public java.lang.String getDisallowedField(java.lang.String allowedfield)
Deprecated. 
Specified by:
getDisallowedField in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

getAllowedField

public java.lang.String getAllowedField(java.lang.String disallowedfield)
Deprecated. 
Specified by:
getAllowedField in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

getConnection

public MultiConnection getConnection(JDBCInterface jdbc)
                              throws java.sql.SQLException
Deprecated. 
Specified by:
getConnection in interface MMJdbc2NodeInterface
Throws:
java.sql.SQLException
Warning: No Java Documentation Available.

getNumberString

public java.lang.String getNumberString()
Deprecated. 
Specified by:
getNumberString in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

getOTypeString

public java.lang.String getOTypeString()
Deprecated. 
Specified by:
getOTypeString in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

getOwnerString

public java.lang.String getOwnerString()
Deprecated. 
Specified by:
getOwnerString in interface MMJdbc2NodeInterface
Warning: No Java Documentation Available.

tableSizeProtection

public boolean tableSizeProtection(MMObjectBuilder bul)
Deprecated. 
Warning: No Java Documentation Available.


MMBase build 1.7.4.20050922