org.mmbase.module.database.support
Class Sql92SingleFields

java.lang.Object
  extended byorg.mmbase.module.database.support.BaseJdbc2Node
      extended byorg.mmbase.module.database.support.Sql92SingleFields
All Implemented Interfaces:
MMJdbc2NodeInterface, SearchQueryHandler
Direct Known Subclasses:
PostgreSQL, Sql92WithViews

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

public abstract class Sql92SingleFields
extends BaseJdbc2Node
implements MMJdbc2NodeInterface

Generic node handler for database's with the information stored on one location.

Version:
$Id: Sql92SingleFields.java,v 1.4.2.1 2004/06/15 21:38:35 robmaris Exp $
Author:
Eduard Witteveen

Field Summary
protected  java.util.HashMap allowed2disallowed
          Deprecated.  
protected  java.util.HashMap disallowed2allowed
          Deprecated.  
protected  MMBase mmb
          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
Sql92SingleFields()
          Deprecated.  
 
Method Summary
abstract  boolean addField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
abstract  boolean changeField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
protected  boolean changeMetaData(MMObjectBuilder bul, java.lang.String sql)
          Deprecated.  
abstract  boolean commit(MMObjectBuilder bul, MMObjectNode node)
          Deprecated. commit this node to the database
abstract  boolean create(MMObjectBuilder bul)
          Deprecated.  
 boolean created(java.lang.String tableName)
          Deprecated. Tells if a table already exists
 boolean createObjectTable(java.lang.String notUsed)
          Deprecated. is next function nessecary?
protected abstract  boolean createSequence()
          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.  
 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. is next function nessecary?
protected abstract  java.lang.String getDbFieldDef(FieldDefs def, MMObjectBuilder bul)
          Deprecated.  
protected  java.lang.String getDbFieldType(FieldDefs fieldDef, int fieldSize, boolean fieldRequired)
          Deprecated.  
abstract  int getDBKey()
          Deprecated. Retrieves a new unique number, which can be used to inside objectTableName() table
 java.lang.String getDBText(java.sql.ResultSet rs, int idx)
          Deprecated. is next function nessecary?
 java.lang.String getDisallowedField(java.lang.String allowedfield)
          Deprecated.  
protected  MMObjectBuilder getInheritBuilder(MMObjectBuilder bul)
          Deprecated. get the table that we inherit from
protected  java.lang.String getInheritTableName(MMObjectBuilder bul)
          Deprecated. get the table that we inherit from
 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.  
 byte[] getShortedByte(java.lang.String tableName, java.lang.String fieldname, int number)
          Deprecated.  
 java.lang.String getShortedText(java.lang.String tableName, java.lang.String fieldname, int number)
          Deprecated. is next function nessecary?
 void init(MMBase mmb, XMLDatabaseReader parser)
          Deprecated.  
 int insert(MMObjectBuilder bul, java.lang.String owner, MMObjectNode node)
          Deprecated.  
protected abstract  int insertRecord(MMObjectBuilder bul, java.lang.String owner, MMObjectNode node)
          Deprecated.  
 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  boolean isBuilderField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
protected  boolean isInheritedField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated. check if it is a field of this builder, or that it is inherited
protected  boolean isReferenceField(FieldDefs def, MMObjectBuilder bul)
          Deprecated.  
protected  java.lang.String numberCheckNameName()
          Deprecated.  
protected  java.lang.String objectTableName()
          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).
abstract  boolean removeField(MMObjectBuilder bul, java.lang.String fieldname)
          Deprecated.  
 void removeNode(MMObjectBuilder bul, MMObjectNode node)
          Deprecated.  
protected  java.lang.String sequenceTableName()
          Deprecated.  
 void setDBByte(int i, java.sql.PreparedStatement stmt, byte[] bytes)
          Deprecated. is next function nessecary?
protected  boolean setValuePreparedStatement(java.sql.PreparedStatement stmt, MMObjectNode node, java.lang.String key, int i)
          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

mmb

protected MMBase mmb
Deprecated. 

disallowed2allowed

protected java.util.HashMap disallowed2allowed
Deprecated. 

allowed2disallowed

protected java.util.HashMap allowed2disallowed
Deprecated. 
Constructor Detail

Sql92SingleFields

public Sql92SingleFields()
Deprecated. 
Method Detail

init

public void init(MMBase mmb,
                 XMLDatabaseReader parser)
Deprecated. 
Specified by:
init in interface MMJdbc2NodeInterface

getConnection

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

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:
alway's true
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

created

public boolean created(java.lang.String tableName)
Deprecated. 
Description copied from interface: MMJdbc2NodeInterface
Tells if a table already exists

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

createObjectTable

public boolean createObjectTable(java.lang.String notUsed)
Deprecated. 
is next function nessecary?

Specified by:
createObjectTable in interface MMJdbc2NodeInterface

createSequence

protected abstract boolean createSequence()
Deprecated. 

getDisallowedField

public java.lang.String getDisallowedField(java.lang.String allowedfield)
Deprecated. 
Specified by:
getDisallowedField in interface MMJdbc2NodeInterface

getAllowedField

public java.lang.String getAllowedField(java.lang.String disallowedfield)
Deprecated. 
Specified by:
getAllowedField in interface MMJdbc2NodeInterface

getNumberString

public java.lang.String getNumberString()
Deprecated. 
Specified by:
getNumberString in interface MMJdbc2NodeInterface

getOTypeString

public java.lang.String getOTypeString()
Deprecated. 
Specified by:
getOTypeString in interface MMJdbc2NodeInterface

getOwnerString

public java.lang.String getOwnerString()
Deprecated. 
Specified by:
getOwnerString in interface MMJdbc2NodeInterface

sequenceTableName

protected java.lang.String sequenceTableName()
Deprecated. 

numberCheckNameName

protected java.lang.String numberCheckNameName()
Deprecated. 

objectTableName

protected java.lang.String objectTableName()
Deprecated. 

create

public abstract boolean create(MMObjectBuilder bul)
Deprecated. 
Specified by:
create in interface MMJdbc2NodeInterface

getInheritBuilder

protected MMObjectBuilder getInheritBuilder(MMObjectBuilder bul)
Deprecated. 
get the table that we inherit from


getInheritTableName

protected java.lang.String getInheritTableName(MMObjectBuilder bul)
Deprecated. 
get the table that we inherit from


isBuilderField

protected boolean isBuilderField(MMObjectBuilder bul,
                                 java.lang.String fieldname)
Deprecated. 

isInheritedField

protected boolean isInheritedField(MMObjectBuilder bul,
                                   java.lang.String fieldname)
Deprecated. 
check if it is a field of this builder, or that it is inherited


isReferenceField

protected boolean isReferenceField(FieldDefs def,
                                   MMObjectBuilder bul)
Deprecated. 

getDbFieldDef

protected abstract java.lang.String getDbFieldDef(FieldDefs def,
                                                  MMObjectBuilder bul)
Deprecated. 

getDbFieldType

protected java.lang.String getDbFieldType(FieldDefs fieldDef,
                                          int fieldSize,
                                          boolean fieldRequired)
Deprecated. 

insert

public int insert(MMObjectBuilder bul,
                  java.lang.String owner,
                  MMObjectNode node)
Deprecated. 
Specified by:
insert in interface MMJdbc2NodeInterface

insertRecord

protected abstract int insertRecord(MMObjectBuilder bul,
                                    java.lang.String owner,
                                    MMObjectNode node)
Deprecated. 

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.

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)

commit

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

Specified by:
commit in interface MMJdbc2NodeInterface

removeNode

public void removeNode(MMObjectBuilder bul,
                       MMObjectNode node)
Deprecated. 
Specified by:
removeNode in interface MMJdbc2NodeInterface

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)

drop

public boolean drop(MMObjectBuilder bul)
Deprecated. 
Specified by:
drop in interface MMJdbc2NodeInterface

updateTable

public boolean updateTable(MMObjectBuilder bul)
Deprecated. 
Specified by:
updateTable in interface MMJdbc2NodeInterface

addField

public abstract boolean addField(MMObjectBuilder bul,
                                 java.lang.String fieldname)
Deprecated. 
Specified by:
addField in interface MMJdbc2NodeInterface

removeField

public abstract boolean removeField(MMObjectBuilder bul,
                                    java.lang.String fieldname)
Deprecated. 
Specified by:
removeField in interface MMJdbc2NodeInterface

changeField

public abstract boolean changeField(MMObjectBuilder bul,
                                    java.lang.String fieldname)
Deprecated. 
Specified by:
changeField in interface MMJdbc2NodeInterface

changeMetaData

protected boolean changeMetaData(MMObjectBuilder bul,
                                 java.lang.String sql)
Deprecated. 

getDBByte

public byte[] getDBByte(java.sql.ResultSet rs,
                        int idx)
Deprecated. 
is next function nessecary?

Specified by:
getDBByte in interface MMJdbc2NodeInterface

setDBByte

public void setDBByte(int i,
                      java.sql.PreparedStatement stmt,
                      byte[] bytes)
Deprecated. 
is next function nessecary?

Specified by:
setDBByte in interface MMJdbc2NodeInterface

getDBKey

public abstract int getDBKey()
Deprecated. 
Retrieves a new unique number, which can be used to inside objectTableName() table

Specified by:
getDBKey in interface MMJdbc2NodeInterface
Returns:
a new unique number for new nodes or -1 on failure

setValuePreparedStatement

protected boolean setValuePreparedStatement(java.sql.PreparedStatement stmt,
                                            MMObjectNode node,
                                            java.lang.String key,
                                            int i)
                                     throws java.sql.SQLException
Deprecated. 
Throws:
java.sql.SQLException

getShortedByte

public byte[] getShortedByte(java.lang.String tableName,
                             java.lang.String fieldname,
                             int number)
Deprecated. 
Specified by:
getShortedByte in interface MMJdbc2NodeInterface

getShortedText

public java.lang.String getShortedText(java.lang.String tableName,
                                       java.lang.String fieldname,
                                       int number)
Deprecated. 
is next function nessecary?

Specified by:
getShortedText in interface MMJdbc2NodeInterface

getDBText

public java.lang.String getDBText(java.sql.ResultSet rs,
                                  int idx)
Deprecated. 
is next function nessecary?

Specified by:
getDBText in interface MMJdbc2NodeInterface


MMBase build 1.7.4.20050922