public class ExpressionSQLPrinter extends Object
Purpose: Expression SQL printer.
Responsibilities:
Modifier and Type | Field and Description |
---|---|
protected SQLCall |
call
Stores the call being created.
|
protected boolean |
isFirstElementPrinted |
protected boolean |
requiresDistinct
Used for distincts in functions.
|
protected AbstractSession |
session
Stores the current session.
|
protected boolean |
shouldPrintQualifiedNames
Indicates whether fully qualified field names
(owner + table) should be used or not.
|
protected AbstractRecord |
translationRow
Stores the row.
|
protected Writer |
writer |
Constructor and Description |
---|
ExpressionSQLPrinter(AbstractSession session,
AbstractRecord translationRow,
SQLCall call,
boolean printQualifiedNames) |
Modifier and Type | Method and Description |
---|---|
protected SQLCall |
getCall()
Return the call.
|
DatabasePlatform |
getPlatform()
INTERNAL:
Return the database platform specific information.
|
protected AbstractSession |
getSession() |
protected AbstractRecord |
getTranslationRow()
INTERNAL:
Return the row for translation
|
Writer |
getWriter() |
boolean |
isFirstElementPrinted()
INTERNAL:
Used in figuring out when to print a comma in the select clause
|
void |
printExpression(Expression expression) |
void |
printField(DatabaseField field) |
void |
printNull(ConstantExpression nullValueExpression) |
void |
printParameter(DatabaseField field) |
void |
printParameter(ParameterExpression expression) |
void |
printPrimitive(Object value) |
void |
printString(String value) |
void |
printValuelist(Vector values) |
boolean |
requiresDistinct()
If a distinct has been set the DISTINCT clause will be printed.
|
protected void |
setCall(SQLCall call) |
void |
setIsFirstElementPrinted(boolean isFirstElementPrinted)
INTERNAL:
Used in figuring out when to print a comma in the select clause
|
void |
setRequiresDistinct(boolean requiresDistinct)
If a distinct has been set the DISTINCT clause will be printed.
|
protected void |
setSession(AbstractSession theSession) |
protected void |
setShouldPrintQualifiedNames(boolean shouldPrintQualifiedNames) |
protected void |
setTranslationRow(AbstractRecord theRow)
INTERNAL:
Set the row for translation
|
void |
setWriter(Writer writer) |
boolean |
shouldPrintParameterValues() |
protected boolean |
shouldPrintQualifiedNames() |
protected void |
translateExpression(Expression theExpression)
Translate an expression i.e.
|
protected AbstractSession session
protected SQLCall call
protected AbstractRecord translationRow
protected boolean shouldPrintQualifiedNames
protected Writer writer
protected boolean requiresDistinct
protected boolean isFirstElementPrinted
public ExpressionSQLPrinter(AbstractSession session, AbstractRecord translationRow, SQLCall call, boolean printQualifiedNames)
protected SQLCall getCall()
public DatabasePlatform getPlatform()
protected AbstractSession getSession()
protected AbstractRecord getTranslationRow()
public Writer getWriter()
public boolean isFirstElementPrinted()
public void printExpression(Expression expression)
public void printField(DatabaseField field)
public void printParameter(ParameterExpression expression)
public void printParameter(DatabaseField field)
public void printPrimitive(Object value)
public void printNull(ConstantExpression nullValueExpression)
public void printString(String value)
public void printValuelist(Vector values)
public boolean requiresDistinct()
protected void setCall(SQLCall call)
public void setIsFirstElementPrinted(boolean isFirstElementPrinted)
public void setRequiresDistinct(boolean requiresDistinct)
protected void setSession(AbstractSession theSession)
protected void setShouldPrintQualifiedNames(boolean shouldPrintQualifiedNames)
protected void setTranslationRow(AbstractRecord theRow)
public void setWriter(Writer writer)
public boolean shouldPrintParameterValues()
protected boolean shouldPrintQualifiedNames()
protected void translateExpression(Expression theExpression)
Copyright © 2024. All rights reserved.