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

java.lang.Object
  extended by org.apache.ojb.broker.accesslayer.sql.SqlPkStatement
All Implemented Interfaces:
SqlStatement
Direct Known Subclasses:
SqlDeleteByPkStatement, SqlExistStatement, SqlInsertStatement, SqlUpdateStatement

public abstract class SqlPkStatement
extends Object
implements SqlStatement

Model simple Statements based on ClassDescriptor and/or PrimaryKey

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

Field Summary
private  WeakReference m_classDescriptor
           
private  Logger m_logger
           
 
Constructor Summary
SqlPkStatement(ClassDescriptor aCld, Logger aLogger)
          Constructor for SqlPkStatement.
 
Method Summary
protected  void appendTable(ClassDescriptor cld, StringBuffer stmt)
          append table name
protected  void appendWhereClause(ClassDescriptor cld, boolean useLocking, StringBuffer stmt)
          Generate a where clause for a prepared Statement.
protected  void appendWhereClause(FieldDescriptor[] fields, StringBuffer stmt)
          Generate a sql where-clause for the array of fields
protected  ClassDescriptor getClassDescriptor()
          Returns the classDescriptor.
protected  Logger getLogger()
          Returns the logger.
 
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
 

Field Detail

m_classDescriptor

private WeakReference m_classDescriptor

m_logger

private Logger m_logger
Constructor Detail

SqlPkStatement

public SqlPkStatement(ClassDescriptor aCld,
                      Logger aLogger)
Constructor for SqlPkStatement.

Method Detail

appendTable

protected void appendTable(ClassDescriptor cld,
                           StringBuffer stmt)
append table name


getLogger

protected Logger getLogger()
Returns the logger.

Returns:
Logger

getClassDescriptor

protected ClassDescriptor getClassDescriptor()
Returns the classDescriptor.

Returns:
ClassDescriptor

appendWhereClause

protected void appendWhereClause(FieldDescriptor[] fields,
                                 StringBuffer stmt)
                          throws PersistenceBrokerException
Generate a sql where-clause for the array of fields

Parameters:
fields - array containing all columns used in WHERE clause
Throws:
PersistenceBrokerException

appendWhereClause

protected void appendWhereClause(ClassDescriptor cld,
                                 boolean useLocking,
                                 StringBuffer stmt)
Generate a where clause for a prepared Statement. Only primary key and locking fields are used in this where clause

Parameters:
cld - the ClassDescriptor
useLocking - true if locking fields should be included
stmt - the StatementBuffer


Copyright © 2007-2011 The Kuali Foundation. All Rights Reserved.