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, updateObject
getDatabaseCall, prepareCall, prepareExecute, setCallHasCustomSQLArguments, unprepare, updateForeignKeyFieldBeforeDelete
addCall, cursorSelectAllRows, deleteAll, deleteAllUsingTempTables, execute, executeDeferredCall, executeNoSelectCall, executeSelect, executeSelectCall, getCall, getCalls, hasMultipleCalls, selectResultSet, selectRowForDoesExist, setCall, updateAll, updateAllUsingTempTables
buildSelectionCriteria, clone, executeWrite, executeWriteWithChangeSet, getModifyRow, getQuery, insertObjectForWrite, isJPQLCallQueryMechanism, isQueryByExampleMechanism, setQuery, updateObjectForWrite, updateObjectForWriteWithChangeSet
public 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 DatabaseQueryMechanism
public void clearStatement()
clearStatement
in class StatementQueryMechanism
public DatabaseQueryMechanism clone(DatabaseQuery queryClone)
clone
in class StatementQueryMechanism
public ExpressionBuilder getExpressionBuilder()
public Expression getSelectionCriteria()
getSelectionCriteria
in class StatementQueryMechanism
public java.util.Vector getSelectionFields(SQLSelectStatement statement, boolean includeAllSubclassFields)
public boolean isExpressionQueryMechanism()
isExpressionQueryMechanism
in class DatabaseQueryMechanism
public boolean isStatementQueryMechanism()
isStatementQueryMechanism
in class StatementQueryMechanism
public void prepare() throws QueryException
prepare
in class StatementQueryMechanism
QueryException
public void prepareCursorSelectAllRows()
prepareCursorSelectAllRows
in class StatementQueryMechanism
public void prepareDeleteAll()
prepareDeleteAll
in class StatementQueryMechanism
public void prepareDeleteObject()
prepareDeleteObject
in class StatementQueryMechanism
public void prepareDoesExist(DatabaseField field)
prepareDoesExist
in class StatementQueryMechanism
public void prepareInsertObject()
prepareInsertObject
in class StatementQueryMechanism
public void prepareReportQuerySelectAllRows()
prepareReportQuerySelectAllRows
in class DatasourceCallQueryMechanism
public void prepareReportQuerySubSelect()
prepareReportQuerySubSelect
in class DatasourceCallQueryMechanism
public void prepareSelectAllRows()
prepareSelectAllRows
in class StatementQueryMechanism
public void prepareSelectOneRow()
prepareSelectOneRow
in class StatementQueryMechanism
public void prepareUpdateObject()
prepareUpdateObject
in class StatementQueryMechanism
public void prepareUpdateAll()
prepareUpdateAll
in class StatementQueryMechanism
public java.util.Vector selectAllReportQueryRows() throws DatabaseException
selectAllReportQueryRows
in class DatasourceCallQueryMechanism
DatabaseException
- - an error has occurred on the database.public java.util.Vector selectAllRows() throws DatabaseException
selectAllRows
in class DatasourceCallQueryMechanism
DatabaseException
- - an error has occurred on the database.public java.util.Vector selectAllRowsFromConcreteTable() throws DatabaseException
DatabaseException
public java.util.Vector selectAllRowsFromTable() throws DatabaseException
DatabaseException
- - an error has occurred on the database.public AbstractRecord selectOneRow() throws DatabaseException
selectOneRow
in class DatasourceCallQueryMechanism
DatabaseException
- - an error has occurred on the databasepublic AbstractRecord selectOneRowFromConcreteTable() throws DatabaseException
DatabaseException
public AbstractRecord selectOneRowFromTable() throws DatabaseException
DatabaseException
public void setSelectionCriteria(Expression expression)
EclipseLink 2.6.3, "build v20160428-59c81c5" API Reference