Module org.eclipse.persistence.core
Class ExpressionSQLPrinter
java.lang.Object
org.eclipse.persistence.internal.expressions.ExpressionSQLPrinter
Purpose: Expression SQL printer.
Responsibilities:
- Print an expression in SQL format.
- Replaces FIELD types with field names from the descriptor.
- Replaces PARAMETER types with row or object values.
- Calls accessor to print primitive types.
- Since:
- TOPLink/Java 1.0
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected SQLCallStores the call being created.protected booleanprotected DatabasePlatformStores the current platform to access platform specific functions.protected booleanUsed for distincts in functions.protected AbstractSessionStores the current session.protected booleanIndicates whether fully qualified field names (owner + table) should be used or not.protected AbstractRecordStores the row.protected Writer -
Constructor Summary
ConstructorsConstructorDescriptionExpressionSQLPrinter(AbstractSession session, AbstractRecord translationRow, SQLCall call, boolean printQualifiedNames, ExpressionBuilder builder) -
Method Summary
Modifier and TypeMethodDescriptiongetCall()Return the call.INTERNAL: Return the database platform specific information.protected AbstractSessionprotected AbstractRecordINTERNAL: Return the row for translationbooleanINTERNAL: Used in figuring out when to print a comma in the select clausevoidprintExpression(Expression expression) voidprintField(DatabaseField field) voidprintField(DatabaseField field, DatabaseTable tableAlias) voidprintList(Collection<Object> values, Boolean canBind) voidprintNull(ConstantExpression nullValueExpression) voidprintParameter(ParameterExpression expression) voidprintParameter(DatabaseField field) voidprintPrimitive(Object value, Boolean canBind) voidprintString(String value) voidprintValuelist(Collection<Object> values, Boolean canBind) booleanIf a distinct has been set the DISTINCT clause will be printed.protected voidvoidsetIsFirstElementPrinted(boolean isFirstElementPrinted) INTERNAL: Used in figuring out when to print a comma in the select clausevoidsetRequiresDistinct(boolean requiresDistinct) If a distinct has been set the DISTINCT clause will be printed.protected voidsetSession(AbstractSession theSession) protected voidsetShouldPrintQualifiedNames(boolean shouldPrintQualifiedNames) protected voidsetTranslationRow(AbstractRecord theRow) INTERNAL: Set the row for translationvoidbooleanprotected booleanprotected voidtranslateExpression(Expression theExpression) Translate an expression i.e.
-
Field Details
-
session
Stores the current session. The session accessor is used to print all the primitive types. -
platform
Stores the current platform to access platform specific functions. -
call
Stores the call being created. -
translationRow
Stores the row. Used to print PARAMETER nodes. -
shouldPrintQualifiedNames
protected boolean shouldPrintQualifiedNamesIndicates whether fully qualified field names (owner + table) should be used or not. -
writer
-
requiresDistinct
protected boolean requiresDistinctUsed for distincts in functions. -
isFirstElementPrinted
protected boolean isFirstElementPrinted
-
-
Constructor Details
-
ExpressionSQLPrinter
public ExpressionSQLPrinter(AbstractSession session, AbstractRecord translationRow, SQLCall call, boolean printQualifiedNames, ExpressionBuilder builder)
-
-
Method Details
-
getCall
Return the call. -
getPlatform
INTERNAL: Return the database platform specific information. -
getSession
-
getTranslationRow
INTERNAL: Return the row for translation -
getWriter
-
isFirstElementPrinted
public boolean isFirstElementPrinted()INTERNAL: Used in figuring out when to print a comma in the select clause -
printExpression
-
printField
-
printField
-
printParameter
-
printParameter
-
printPrimitive
-
printNull
-
printString
-
printValuelist
-
printList
-
requiresDistinct
public boolean requiresDistinct()If a distinct has been set the DISTINCT clause will be printed. This is required for batch reading. -
setCall
-
setIsFirstElementPrinted
public void setIsFirstElementPrinted(boolean isFirstElementPrinted) INTERNAL: Used in figuring out when to print a comma in the select clause -
setRequiresDistinct
public void setRequiresDistinct(boolean requiresDistinct) If a distinct has been set the DISTINCT clause will be printed. This is required for batch reading. -
setSession
-
setShouldPrintQualifiedNames
protected void setShouldPrintQualifiedNames(boolean shouldPrintQualifiedNames) -
setTranslationRow
INTERNAL: Set the row for translation -
setWriter
-
shouldPrintParameterValues
public boolean shouldPrintParameterValues() -
shouldPrintQualifiedNames
protected boolean shouldPrintQualifiedNames() -
translateExpression
Translate an expression i.e. call the appropriate translation method for the expression based on its type. The translation method is then responsible for translating the subexpressions.
-