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

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

public abstract class SqlPkStatement
extends java.lang.Object
implements SqlStatement

Model simple Statements based on ClassDescriptor and/or PrimaryKey

Version:
$Id: SqlPkStatement.java,v 1.3 2002/10/08 13:20:18 brj Exp $
Author:
Jakob Braeuchi

Constructor Summary
SqlPkStatement(ClassDescriptor aCld, Logger aLogger)
          Constructor for SqlPkStatement.
 
Method Summary
protected  void appendTable(ClassDescriptor cld, java.lang.StringBuffer stmt)
          append table name
protected  void appendWhereClause(ClassDescriptor cld, boolean useLocking, java.lang.StringBuffer stmt)
          Generate a where clause for a prepared Statement.
protected  void appendWhereClause(FieldDescriptor[] fields, java.lang.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
 

Constructor Detail

SqlPkStatement

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

Method Detail

appendTable

protected void appendTable(ClassDescriptor cld,
                           java.lang.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,
                                 java.lang.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,
                                 java.lang.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


Authors: Thomas Mahler and others. (C) 2000 - 2003 Apache Software Foundation
All rights reserved. Published under the Apache License.
http://db.apache.org/ojb
Version: 1.0.rc5, 2003-12-14