org.rimudb.generic
Class AbstractGenericBase

java.lang.Object
  extended by org.rimudb.generic.AbstractGenericBase
Direct Known Subclasses:
GenericQuery, GenericUpdate, IterativeQuery

public abstract class AbstractGenericBase
extends java.lang.Object

An abstract class for Generic queries.


Constructor Summary
AbstractGenericBase(Database database)
          Constructor for AbstractGenericBase.
AbstractGenericBase(Database database, java.lang.String sql)
          Constructor for AbstractGenericBase.
 
Method Summary
static java.lang.String buildElementString(java.lang.String[] elements)
          Convert the array of Strings to an SQL list in the form: ('element1', 'element2', ...)
static java.lang.String buildParameterString(int parameterCount)
          Return a string containing an SQL list of parameterized values (?, ?, ?, ...)
protected  Database getDatabase()
           
 int getFetchSize()
           
protected  java.lang.String getSQL()
           
protected  java.lang.String parse(java.lang.String psql)
          Parse the SQL statement, replacing {dataobject} with table names.
 void setFetchSize(int fetchSize)
           
protected  void setSQL(java.lang.String sql)
          Set the SQL statement
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractGenericBase

public AbstractGenericBase(Database database)
                    throws RimuDBException
Constructor for AbstractGenericBase.

Throws:
RimuDBException

AbstractGenericBase

public AbstractGenericBase(Database database,
                           java.lang.String sql)
                    throws RimuDBException
Constructor for AbstractGenericBase.

Throws:
RimuDBException
Method Detail

getDatabase

protected Database getDatabase()

getSQL

protected java.lang.String getSQL()

setSQL

protected void setSQL(java.lang.String sql)
Set the SQL statement

Parameters:
sql -

buildElementString

public static java.lang.String buildElementString(java.lang.String[] elements)
Convert the array of Strings to an SQL list in the form: ('element1', 'element2', ...)


buildParameterString

public static java.lang.String buildParameterString(int parameterCount)
Return a string containing an SQL list of parameterized values (?, ?, ?, ...)


parse

protected java.lang.String parse(java.lang.String psql)
                          throws RimuDBException
Parse the SQL statement, replacing {dataobject} with table names.

Parameters:
psql -
Returns:
String
Throws:
RimuDBException

setFetchSize

public void setFetchSize(int fetchSize)
Parameters:
fetchSize - the fetchSize to set

getFetchSize

public int getFetchSize()
Returns:
the fetchSize


Copyright © 2008-2011 Simon Ritchie. All Rights Reserved.