org.exolab.castor.jdo.drivers
Class HsqlQueryExpression

java.lang.Object
  extended byorg.exolab.castor.jdo.drivers.JDBCQueryExpression
      extended byorg.exolab.castor.jdo.drivers.HsqlQueryExpression
All Implemented Interfaces:
QueryExpression

public final class HsqlQueryExpression
extends JDBCQueryExpression

QueryExpression for HypersonicSQL.

This implementation was created mainly to allow the use of multiple outer joins during HSQL query expression creation. The syntax provided by the generic driver does not work with HSQL so this class was needed.

Author:
Santiago Arriaga

Nested Class Summary
(package private)  class HsqlQueryExpression.HsqlAliasInfo
          This class encapsulates the information of the aliases related to sql outer joins.
 
Nested classes inherited from class org.exolab.castor.jdo.drivers.JDBCQueryExpression
JDBCQueryExpression.Join
 
Field Summary
 
Fields inherited from class org.exolab.castor.jdo.drivers.JDBCQueryExpression
_cols, _conds, _distinct, _factory, _joins, _limit, _order, _select, _tables, _where
 
Fields inherited from interface org.exolab.castor.persist.spi.QueryExpression
OpBetween, OpBetweenAnd, OpEquals, OpGreater, OpGreaterEquals, OpLess, OpLessEquals, OpLike, OpNotEquals, OpNotLike
 
Constructor Summary
HsqlQueryExpression(PersistenceFactory factory)
          Public constructor
 
Method Summary
 void addColumn(java.lang.String tableName, java.lang.String columnName)
          Redefinition of JDBCQueryExpression.addColumn() method.
 void addCondition(java.lang.String tableName, java.lang.String columnName, java.lang.String condOp, java.lang.String value)
          Redefinition of JDBCQueryExpression.addCondition() method.
protected  boolean addWhereClause(java.lang.StringBuffer buffer, HsqlQueryExpression.HsqlAliasInfo aliasInfo, boolean first)
          This method adds the where clause taking into account possible aliases for columns
 java.lang.String getStatement(boolean lock)
          This should work for JDBC drivers with a full support of JDBC specification.
 
Methods inherited from class org.exolab.castor.jdo.drivers.JDBCQueryExpression
addInnerJoin, addInnerJoin, addInnerJoin, addInnerJoin, addLimitClause, addOrderClause, addOuterJoin, addOuterJoin, addOuterJoin, addOuterJoin, addParameter, addSelect, addTable, addTable, addWhereClause, addWhereClause, clone, encodeColumn, getColumnList, getStandardStatement, setDistinct, toString
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

HsqlQueryExpression

public HsqlQueryExpression(PersistenceFactory factory)
Public constructor

Method Detail

addColumn

public final void addColumn(java.lang.String tableName,
                            java.lang.String columnName)
Redefinition of JDBCQueryExpression.addColumn() method. This is needed because aliases are sometimes needed during the creation of HSQL expressions involving multiple outer joins. The original implementation does not allows this.

Specified by:
addColumn in interface QueryExpression
Overrides:
addColumn in class JDBCQueryExpression

addCondition

public void addCondition(java.lang.String tableName,
                         java.lang.String columnName,
                         java.lang.String condOp,
                         java.lang.String value)
Redefinition of JDBCQueryExpression.addCondition() method. This is needed because aliases are sometimes needed during the creation of HSQL expressions involving multiple outer joins. The original implementation does not allows this.

Specified by:
addCondition in interface QueryExpression
Overrides:
addCondition in class JDBCQueryExpression

getStatement

public java.lang.String getStatement(boolean lock)
Description copied from class: JDBCQueryExpression
This should work for JDBC drivers with a full support of JDBC specification.

Specified by:
getStatement in interface QueryExpression
Overrides:
getStatement in class JDBCQueryExpression

addWhereClause

protected boolean addWhereClause(java.lang.StringBuffer buffer,
                                 HsqlQueryExpression.HsqlAliasInfo aliasInfo,
                                 boolean first)
This method adds the where clause taking into account possible aliases for columns

Parameters:
buffer - The buffer being appended
aliasInfo - The information of the aliases to be substituted for some tables


Intalio Inc. (C) 1999-2001. All rights reserved http://www.intalio.com