public class ExpressionQueryMechanism extends StatementQueryMechanism
Purpose: Mechanism used for all expression read queries. ExpressionQueryInterface understands how to deal with expressions.
Responsibilities: Translates the expression and creates the appropriate SQL statements. Retrieves the data from the database and return the results to the query.
| Constructor and Description |
|---|
ExpressionQueryMechanism() |
ExpressionQueryMechanism(DatabaseQuery query)
Initialize the state of the query
|
ExpressionQueryMechanism(DatabaseQuery query,
Expression expression)
Initialize the state of the query
|
| Modifier and Type | Method and Description |
|---|---|
java.util.Vector |
aliasPresetFields(SQLSelectStatement statement)
If the fields in the statement have breen pre-set, e.g.
|
Expression |
buildBaseSelectionCriteria(boolean isSubSelect,
java.util.Map clonedExpressions)
Create the appropriate where clause.
|
Expression |
buildBaseSelectionCriteria(boolean isSubSelect,
java.util.Map clonedExpressions,
boolean shouldUseAdditionalJoinExpression)
Create the appropriate where clause.
|
SQLSelectStatement |
buildBaseSelectStatement(boolean isSubSelect,
java.util.Map clonedExpressions)
Return the appropriate select statement containing the fields in the table.
|
SQLSelectStatement |
buildBaseSelectStatement(boolean isSubSelect,
java.util.Map clonedExpressions,
boolean shouldUseAdditionalJoinExpression)
Return the appropriate select statement containing the fields in the table.
|
java.lang.Object |
checkCacheForObject(AbstractRecord translationRow,
AbstractSession session)
Perform a cache lookup for the query
This is only called from read object query.
|
void |
clearStatement()
The statement is no longer require after prepare so can be released.
|
DatabaseQueryMechanism |
clone(DatabaseQuery queryClone)
Clone the mechanism for the specified query clone.
|
void |
extractStatementFromItem(ReportItem item,
java.util.Map clonedExpressions,
SQLSelectStatement selectStatement,
java.util.Vector fieldExpressions) |
ExpressionBuilder |
getExpressionBuilder()
Return an expression builder which is valid for us
|
Expression |
getSelectionCriteria()
Return the selection criteria of the query.
|
java.util.Vector |
getSelectionFields(SQLSelectStatement statement,
boolean includeAllSubclassFields)
Return the fields required in the select clause.
|
boolean |
isExpressionQueryMechanism()
Return true if this is an expression query mechanism.
|
boolean |
isStatementQueryMechanism()
Return true if this is a statement query mechanism
|
void |
prepare()
Override super to do nothing.
|
void |
prepareCursorSelectAllRows()
Pre-build the SQL statement from the expression.
|
void |
prepareDeleteAll()
Pre-build the SQL statement from the expression.
|
void |
prepareDeleteObject()
Pre-build the SQL statement from the expression.
|
void |
prepareDoesExist(DatabaseField field)
Pre-build the SQL statement from the expression.
|
void |
prepareInsertObject()
Pre-build the SQL statement from the expression.
|
void |
prepareReportQuerySelectAllRows()
Pre-build the SQL statement from the expression.
|
void |
prepareReportQuerySubSelect()
Pre-build the SQL statement from the expression.
|
void |
prepareSelectAllRows()
Pre-build the SQL statement from the expression.
|
void |
prepareSelectOneRow()
Pre-build the SQL statement from the expression.
|
void |
prepareUpdateAll()
Pre-build the SQL statement from the expressions.
|
void |
prepareUpdateObject()
Pre-build the SQL statement from the expression.
|
java.util.Vector |
selectAllReportQueryRows()
INTERNAL
Read all rows from the database.
|
java.util.Vector |
selectAllRows()
Read all rows from the database.
|
java.util.Vector |
selectAllRowsFromConcreteTable()
Read all rows from the database.
|
java.util.Vector |
selectAllRowsFromTable()
Read all rows from the database.
|
AbstractRecord |
selectOneRow()
Read a single row from the database.
|
AbstractRecord |
selectOneRowFromConcreteTable()
Read a single row from the database.
|
AbstractRecord |
selectOneRowFromTable()
Read a single row from the database.
|
void |
setSelectionCriteria(Expression expression)
Set the selection criteria of the query.
|
deleteObject, executeNoSelect, getSQLStatement, getSQLStatements, hasMultipleStatements, insertObject, insertObject, isCallQueryMechanism, prepareExecuteNoSelect, prepareExecuteSelect, setSQLStatement, trimFieldsForInsert, updateObjectgetDatabaseCall, prepareCall, prepareExecute, setCallHasCustomSQLArguments, unprepare, updateForeignKeyFieldBeforeDeleteaddCall, cursorSelectAllRows, deleteAll, deleteAllUsingTempTables, execute, executeDeferredCall, executeNoSelectCall, executeSelect, executeSelectCall, getCall, getCalls, hasMultipleCalls, selectResultSet, selectRowForDoesExist, setCall, updateAll, updateAllUsingTempTablesbuildSelectionCriteria, clone, executeWrite, executeWriteWithChangeSet, getModifyRow, getQuery, insertObjectForWrite, isJPQLCallQueryMechanism, isQueryByExampleMechanism, setQuery, updateObjectForWrite, updateObjectForWriteWithChangeSetpublic ExpressionQueryMechanism()
public ExpressionQueryMechanism(DatabaseQuery query)
query - - owner of mechanismpublic ExpressionQueryMechanism(DatabaseQuery query, Expression expression)
query - - owner of mechanismexpression - - selection criteriapublic java.util.Vector aliasPresetFields(SQLSelectStatement statement)
public Expression buildBaseSelectionCriteria(boolean isSubSelect, java.util.Map clonedExpressions)
public Expression buildBaseSelectionCriteria(boolean isSubSelect, java.util.Map clonedExpressions, boolean shouldUseAdditionalJoinExpression)
public SQLSelectStatement buildBaseSelectStatement(boolean isSubSelect, java.util.Map clonedExpressions)
public SQLSelectStatement buildBaseSelectStatement(boolean isSubSelect, java.util.Map clonedExpressions, boolean shouldUseAdditionalJoinExpression)
public void extractStatementFromItem(ReportItem item, java.util.Map clonedExpressions, SQLSelectStatement selectStatement, java.util.Vector fieldExpressions)
public java.lang.Object checkCacheForObject(AbstractRecord translationRow, AbstractSession session)
checkCacheForObject in class DatabaseQueryMechanismpublic void clearStatement()
clearStatement in class StatementQueryMechanismpublic DatabaseQueryMechanism clone(DatabaseQuery queryClone)
clone in class StatementQueryMechanismpublic ExpressionBuilder getExpressionBuilder()
public Expression getSelectionCriteria()
getSelectionCriteria in class StatementQueryMechanismpublic java.util.Vector getSelectionFields(SQLSelectStatement statement, boolean includeAllSubclassFields)
public boolean isExpressionQueryMechanism()
isExpressionQueryMechanism in class DatabaseQueryMechanismpublic boolean isStatementQueryMechanism()
isStatementQueryMechanism in class StatementQueryMechanismpublic void prepare()
throws QueryException
prepare in class StatementQueryMechanismQueryExceptionpublic void prepareCursorSelectAllRows()
prepareCursorSelectAllRows in class StatementQueryMechanismpublic void prepareDeleteAll()
prepareDeleteAll in class StatementQueryMechanismpublic void prepareDeleteObject()
prepareDeleteObject in class StatementQueryMechanismpublic void prepareDoesExist(DatabaseField field)
prepareDoesExist in class StatementQueryMechanismpublic void prepareInsertObject()
prepareInsertObject in class StatementQueryMechanismpublic void prepareReportQuerySelectAllRows()
prepareReportQuerySelectAllRows in class DatasourceCallQueryMechanismpublic void prepareReportQuerySubSelect()
prepareReportQuerySubSelect in class DatasourceCallQueryMechanismpublic void prepareSelectAllRows()
prepareSelectAllRows in class StatementQueryMechanismpublic void prepareSelectOneRow()
prepareSelectOneRow in class StatementQueryMechanismpublic void prepareUpdateObject()
prepareUpdateObject in class StatementQueryMechanismpublic void prepareUpdateAll()
prepareUpdateAll in class StatementQueryMechanismpublic java.util.Vector selectAllReportQueryRows()
throws DatabaseException
selectAllReportQueryRows in class DatasourceCallQueryMechanismDatabaseException - - an error has occurred on the database.public java.util.Vector selectAllRows()
throws DatabaseException
selectAllRows in class DatasourceCallQueryMechanismDatabaseException - - an error has occurred on the database.public java.util.Vector selectAllRowsFromConcreteTable()
throws DatabaseException
DatabaseExceptionpublic java.util.Vector selectAllRowsFromTable()
throws DatabaseException
DatabaseException - - an error has occurred on the database.public AbstractRecord selectOneRow() throws DatabaseException
selectOneRow in class DatasourceCallQueryMechanismDatabaseException - - an error has occurred on the databasepublic AbstractRecord selectOneRowFromConcreteTable() throws DatabaseException
DatabaseExceptionpublic AbstractRecord selectOneRowFromTable() throws DatabaseException
DatabaseExceptionpublic void setSelectionCriteria(Expression expression)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference