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

java.lang.Object
  extended byorg.apache.ojb.broker.accesslayer.sql.SqlPkStatement
      extended byorg.apache.ojb.broker.accesslayer.sql.SqlSelectByPkStatement
All Implemented Interfaces:
SqlStatement

public class SqlSelectByPkStatement
extends SqlPkStatement

Model a SELECT Statement by Primary Key

Version:
$Id: SqlSelectByPkStatement.java,v 1.5 2002/11/08 13:29:30 brj Exp $
Author:
Jakob Braeuchi

Constructor Summary
SqlSelectByPkStatement(ClassDescriptor cld, Logger logger)
          Constructor for SqlSelectByPkStatement.
 
Method Summary
protected  java.util.List appendListOfColumnsForSelect(ClassDescriptor cld, java.lang.StringBuffer buf)
          Appends to the statement a comma separated list of column names.
 java.lang.String getStatement()
          Answer the SELECT by primary key Sql for the Statement
 
Methods inherited from class org.apache.ojb.broker.accesslayer.sql.SqlPkStatement
appendTable, appendWhereClause, appendWhereClause, getClassDescriptor, getLogger
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SqlSelectByPkStatement

public SqlSelectByPkStatement(ClassDescriptor cld,
                              Logger logger)
Constructor for SqlSelectByPkStatement.

Parameters:
cld -
logger -
Method Detail

appendListOfColumnsForSelect

protected java.util.List appendListOfColumnsForSelect(ClassDescriptor cld,
                                                      java.lang.StringBuffer buf)
Appends to the statement a comma separated list of column names. MBAIRD: if the object being queried on has multiple classes mapped to the table, then we will get all the fields that are a unique set across all those classes so if we need to we can materialize an extent DO NOT use this if order of columns is important. The row readers build reflectively and look up column names to find values, so this is safe. In the case of update, you CANNOT use this as the order of columns is important.

Returns:
list of column names for the set of all unique columns for multiple classes mapped to the same table.

getStatement

public java.lang.String getStatement()
Answer the SELECT by primary key Sql for the Statement



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