FileDocCategorySizeDatePackage
SQLStatement.javaAPI DocGlassfish v2 API4547Tue May 22 16:54:32 BST 2007oracle.toplink.essentials.internal.expressions

SQLStatement

public abstract class SQLStatement extends Object implements Serializable, Cloneable

Purpose: Mirror SQL behavior.

Responsibilities:

  • Mirror SQL behavior.
  • Print as SQL string.
author
Dorin Sandu
since
TOPLink/Java 1.0

Fields Summary
protected Expression
whereClause
protected ExpressionBuilder
builder
protected AbstractRecord
translationRow
Constructors Summary
Methods Summary
public abstract oracle.toplink.essentials.internal.databaseaccess.DatabaseCallbuildCall(oracle.toplink.essentials.internal.sessions.AbstractSession session)
Return SQL call for the statement, through generating the SQL string.

public java.lang.Objectclone()
Clone the Statement

        try {
            return super.clone();
        } catch (CloneNotSupportedException e) {
            throw new InternalError();
        }
    
public oracle.toplink.essentials.expressions.ExpressionBuildergetBuilder()

        return builder;
    
public oracle.toplink.essentials.expressions.ExpressionBuildergetExpressionBuilder()

        return builder;
    
public oracle.toplink.essentials.internal.sessions.AbstractRecordgetTranslationRow()
INTERNAL: Return the row for translation

        return translationRow;
    
public oracle.toplink.essentials.expressions.ExpressiongetWhereClause()

        return whereClause;
    
protected voidsetBuilder(oracle.toplink.essentials.expressions.ExpressionBuilder aBuilder)

        builder = aBuilder;
    
public voidsetTranslationRow(oracle.toplink.essentials.internal.sessions.AbstractRecord theRow)
INTERNAL: Set the row for translation

        translationRow = theRow;
    
public voidsetWhereClause(oracle.toplink.essentials.expressions.Expression expression)

        whereClause = expression;
        if (expression != null) {
            builder = expression.getBuilder();
        }
    
public java.lang.StringtoString()
Try to print the SQL.

        StringWriter writer = new StringWriter();
        writer.write(Helper.getShortClassName(getClass()));
        writer.write("(");

        try {
            DatabaseCall call = buildCall(new DatabaseSessionImpl(new oracle.toplink.essentials.sessions.DatabaseLogin()));
            writer.write(call.getSQLString());
        } catch (Exception exception) {
        }
        writer.write(")");

        return writer.toString();