org.apache.ojb.broker.accesslayer.sql
Class SqlMNStatement

java.lang.Object
  extended by org.apache.ojb.broker.accesslayer.sql.SqlMNStatement
All Implemented Interfaces:
SqlStatement
Direct Known Subclasses:
SqlDeleteMNStatement, SqlInsertMNStatement, SqlSelectMNStatement

public abstract class SqlMNStatement
extends Object
implements SqlStatement

Model a MN-Statement based on Table, Columns and Values

Version:
$Id: SqlMNStatement.java,v 1.1 2007-08-24 22:17:39 ewestfal Exp $
Author:
Jakob Braeuchi

Constructor Summary
SqlMNStatement(String table, String[] columns, Logger logger)
          Constructor for SqlMNStatement.
 
Method Summary
protected  List appendListOfColumns(String[] columns, StringBuffer stmt)
          Appends to the statement a comma separated list of column names.
protected  void appendTable(String table, StringBuffer stmt)
          append table name
protected  void appendWhereClause(StringBuffer stmt, Object[] columns)
          Generate a sql where-clause matching the contraints defined by the array of fields
protected  String[] getColumns()
          Returns the columns.
protected  Logger getLogger()
          Returns the logger.
protected  String getTable()
          Returns the table.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.apache.ojb.broker.accesslayer.sql.SqlStatement
getStatement
 

Constructor Detail

SqlMNStatement

public SqlMNStatement(String table,
                      String[] columns,
                      Logger logger)
Constructor for SqlMNStatement.

Method Detail

appendTable

protected void appendTable(String table,
                           StringBuffer stmt)
append table name


getColumns

protected String[] getColumns()
Returns the columns.

Returns:
String[]

getTable

protected String getTable()
Returns the table.

Returns:
String

getLogger

protected Logger getLogger()
Returns the logger.

Returns:
Logger

appendWhereClause

protected void appendWhereClause(StringBuffer stmt,
                                 Object[] columns)
Generate a sql where-clause matching the contraints defined by the array of fields

Parameters:
columns - array containing all columns used in WHERE clause

appendListOfColumns

protected List appendListOfColumns(String[] columns,
                                   StringBuffer stmt)
Appends to the statement a comma separated list of column names.

Parameters:
columns - defines the columns to be selected (for reports)
Returns:
list of column names


Copyright © 2004-2012 The Kuali Foundation. All Rights Reserved.