Module org.eclipse.persistence.core
Class ExpressionQueryMechanism
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
-
- org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
-
- org.eclipse.persistence.internal.queries.CallQueryMechanism
-
- org.eclipse.persistence.internal.queries.StatementQueryMechanism
-
- org.eclipse.persistence.internal.queries.ExpressionQueryMechanism
-
- All Implemented Interfaces:
Serializable,Cloneable
- Direct Known Subclasses:
JPQLCallQueryMechanism,QueryByExampleMechanism
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.
- Since:
- TOPLink/Java 1.0
- Author:
- Yvon Lavoie
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected ExpressionselectionCriteria-
Fields inherited from class org.eclipse.persistence.internal.queries.StatementQueryMechanism
sqlStatement, sqlStatements
-
Fields inherited from class org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
call, calls
-
Fields inherited from class org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
query
-
-
Constructor Summary
Constructors Constructor Description ExpressionQueryMechanism()ExpressionQueryMechanism(DatabaseQuery query)Initialize the state of the queryExpressionQueryMechanism(DatabaseQuery query, Expression expression)Initialize the state of the query
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected VectoraliasFields(ObjectExpression node, Vector fields)Alias the supplied fields with respect to the expression node.VectoraliasPresetFields(SQLSelectStatement statement)If the fields in the statement have breen pre-set, e.g.ExpressionbuildBaseSelectionCriteria(boolean isSubSelect, Map clonedExpressions)Create the appropriate where clause.ExpressionbuildBaseSelectionCriteria(boolean isSubSelect, Map clonedExpressions, boolean shouldUseAdditionalJoinExpression)Create the appropriate where clause.SQLSelectStatementbuildBaseSelectStatement(boolean isSubSelect, Map clonedExpressions)Return the appropriate select statement containing the fields in the table.SQLSelectStatementbuildBaseSelectStatement(boolean isSubSelect, Map clonedExpressions, boolean shouldUseAdditionalJoinExpression)Return the appropriate select statement containing the fields in the table.protected SQLSelectStatementbuildConcreteSelectStatement()Return the appropriate select statement containing the fields in the table.protected SQLDeleteStatementbuildDeleteAllStatement(DatabaseTable table, Expression inheritanceExpression, SQLCall selectCallForExist, SQLSelectStatement selectStatementForExist, SQLCall selectCallForNotExist, SQLSelectStatement selectStatementForNotExist, Collection primaryKeyFields)Return the appropriate delete statement Passing of a call/ statement pair is used because the same pair may be used several times.protected SQLDeleteStatementbuildDeleteAllStatementForMapping(SQLCall selectCallForExist, SQLSelectStatement selectStatementForExist, Vector sourceFields, Vector targetFields)Create SQLDeleteAllStatements for mappings that may be responsible for references to the objects to be deleted in the tables NOT mapped to any class: ManyToManyMapping and DirectCollectionMapping NOTE: A similar pattern also used in method buildDeleteAllStatementsForMappingsWithTempTable(): if you are updating this method consider applying a similar update to that method as well.protected VectorbuildDeleteAllStatementsForMappings(SQLCall selectCallForExist, SQLSelectStatement selectStatementForExist, boolean dontCheckDescriptor)NOTE: A similar pattern also used in method buildDeleteAllStatementsForMappingsWithTempTable: if you are updating this method consider applying a similar update to that method as well.protected VectorbuildDeleteAllStatementsForMappingsWithTempTable(ClassDescriptor descriptor, DatabaseTable rootTable, boolean dontCheckDescriptor)Build delete statements with temporary table for ManyToMany and DirectCollection mappings.protected SQLDeleteStatementbuildDeleteStatement(DatabaseTable table)Return the appropriate delete statementprotected SQLDeleteStatementbuildDeleteStatementForDeleteAllQuery(DatabaseTable table)Used by DeleteAllQuery to create DeleteStatement in a simple case when selectionCriteria==null.protected SQLDeleteStatementbuildDeleteStatementForDeleteAllQuery(DatabaseTable table, Expression inheritanceExpression)Used by DeleteAllQuery to create DeleteStatement in a simple case when selectionCriteria==null.protected SQLInsertStatementbuildInsertStatement(DatabaseTable table)Return the appropriate insert statementprotected SQLSelectStatementbuildNormalSelectStatement()Return the appropriate select statement containing the fields in the table.protected SQLSelectStatementbuildReportQuerySelectStatement(boolean isSubSelect)Return the appropriate select statement containing the fields in the table.protected SQLSelectStatementbuildReportQuerySelectStatement(boolean isSubSelect, boolean useCustomaryInheritanceExpression, Expression inheritanceExpression, boolean shouldUseAdditionalJoinExpression)Customary inheritance expression is required for DeleteAllQuery and UpdateAllQuery preparation.protected SQLSelectStatementbuildSelectStatementForDoesExist(DatabaseField field)Return the appropriate select statement to perform a does exist checkprotected VectorbuildStatementsForDeleteAllForTempTables()Build SQLStatements for delete all using temporary table.protected VectorbuildStatementsForUpdateAllForTempTables(DatabaseTable table, HashMap databaseFieldsToValues, List<DatabaseField> primaryKeyFields)protected SQLUpdateAllStatementbuildUpdateAllStatement(DatabaseTable table, HashMap databaseFieldsToValues, SQLCall selectCallForExist, SQLSelectStatement selectStatementForExist, Collection primaryKeyFields)protected SQLModifyStatementbuildUpdateAllStatementForOracleAnonymousBlock(HashMap tables_databaseFieldsToValues, HashMap tablesToPrimaryKeyFields)protected SQLUpdateStatementbuildUpdateStatement(DatabaseTable table)Return the appropriate update statementObjectcheckCacheForObject(AbstractRecord translationRow, AbstractSession session)Perform a cache lookup for the query This is only called from read object query.voidclearStatement()The statement is no longer require after prepare so can be released.DatabaseQueryMechanismclone(DatabaseQuery queryClone)Clone the mechanism for the specified query clone.protected SQLSelectStatementcreateSQLSelectStatementForAssignedExpressionForUpdateAll(Expression value)protected SQLSelectStatementcreateSQLSelectStatementForModifyAll(Expression whereClause)protected SQLSelectStatementcreateSQLSelectStatementForModifyAll(Expression whereClause, Expression inheritanceExpression, ClassDescriptor desc, boolean useCustomaryInheritanceExpression, boolean shouldUseAdditionalJoinExpression)Customary inheritance expression is required for DeleteAllQuery and UpdateAllQuery preparation.protected SQLSelectStatementcreateSQLSelectStatementForModifyAllForTempTable(HashMap databaseFieldsToValues)protected SQLSelectStatementcreateSQLSelectStatementForUpdateAllForOracleAnonymousBlock(HashMap tables_databaseFieldsToValues)protected static StringgetAliasTableName(SQLSelectStatement selectStatement, DatabaseTable table, DatasourcePlatform platform)ExpressionBuildergetExpressionBuilder()Return an expression builder which is valid for usprotected ClassDescriptorgetHighestDescriptorMappingTable(DatabaseTable table)Pass to this method a table mapped by query's descriptor.protected List<DatabaseField>getPrimaryKeyFieldsForTable(ClassDescriptor descriptor, DatabaseTable table)protected List<DatabaseField>getPrimaryKeyFieldsForTable(DatabaseTable table)ExpressiongetSelectionCriteria()Return the selection criteria of the query.VectorgetSelectionFields(SQLSelectStatement statement, boolean includeAllSubclassFields)Return the fields required in the select clause.booleanisExpressionQueryMechanism()Return true if this is an expression query mechanism.booleanisStatementQueryMechanism()Return true if this is a statement query mechanismvoidprepare()Override super to do nothing.voidprepareCursorSelectAllRows()Pre-build the SQL statement from the expression.voidprepareDeleteAll()Pre-build the SQL statement from the expression.protected voidprepareDeleteAll(List<DatabaseTable> tablesToIgnore, boolean isWhereClauseRequired)Pre-build the SQL statement from the expression.protected voidprepareDeleteAllUsingTempStorage()protected voidprepareDeleteAllUsingTempTables()voidprepareDeleteObject()Pre-build the SQL statement from the expression.voidprepareDoesExist(DatabaseField field)Pre-build the SQL statement from the expression.voidprepareInsertObject()Pre-build the SQL statement from the expression.voidprepareReportQuerySelectAllRows()Pre-build the SQL statement from the expression.voidprepareReportQuerySubSelect()Pre-build the SQL statement from the expression.voidprepareSelectAllRows()Pre-build the SQL statement from the expression.voidprepareSelectOneRow()Pre-build the SQL statement from the expression.voidprepareUpdateAll()Pre-build the SQL statement from the expressions.protected voidprepareUpdateAllUsingOracleAnonymousBlock(HashMap tables_databaseFieldsToValues, HashMap tablesToPrimaryKeyFields)Pre-build the SQL statement from the expressions.protected voidprepareUpdateAllUsingTempStorage(HashMap tables_databaseFieldsToValues, HashMap<DatabaseTable,List<DatabaseField>> tablesToPrimaryKeyFields)protected voidprepareUpdateAllUsingTempTables(HashMap tables_databaseFieldsToValues, HashMap<DatabaseTable,List<DatabaseField>> tablesToPrimaryKeyFields)Pre-build the SQL statement from the expressions.voidprepareUpdateObject()Pre-build the SQL statement from the expression.VectorselectAllReportQueryRows()INTERNAL Read all rows from the database.VectorselectAllRows()Read all rows from the database.VectorselectAllRowsFromConcreteTable()Read all rows from the database.VectorselectAllRowsFromTable()Read all rows from the database.AbstractRecordselectOneRow()Read a single row from the database.AbstractRecordselectOneRowFromConcreteTable()Read a single row from the database.AbstractRecordselectOneRowFromTable()Read a single row from the database.voidsetSelectionCriteria(Expression expression)Set the selection criteria of the query.protected booleanshouldBuildDeleteStatementForMapping(ForeignReferenceMapping frMapping, boolean dontCheckDescriptor, ClassDescriptor descriptor)protected booleanshouldIncludeAllSubclassFields(SQLSelectStatement selectStatement)Return whether to include all subclass fields in select statement or not.-
Methods inherited from class org.eclipse.persistence.internal.queries.StatementQueryMechanism
configureDatabaseCall, deleteObject, executeNoSelect, getSQLStatement, getSQLStatements, hasMultipleStatements, insertObject, insertObject, isCallQueryMechanism, prepareExecuteNoSelect, prepareExecuteSelect, setCallFromStatement, setSQLStatement, setSQLStatements, trimFieldsForInsert, updateObject
-
Methods inherited from class org.eclipse.persistence.internal.queries.CallQueryMechanism
getDatabaseCall, prepareCall, prepareExecute, prepareJoining, setCallHasCustomSQLArguments, unprepare, updateForeignKeyFieldAfterInsert, updateForeignKeyFieldBeforeDelete
-
Methods inherited from class org.eclipse.persistence.internal.queries.DatasourceCallQueryMechanism
addCall, computeAndSetItemOffset, cursorSelectAllRows, deleteAll, deleteAllUsingTempTables, execute, executeCall, executeCall, executeDeferredCall, executeNoSelectCall, executeSelect, executeSelectCall, generateKeysExecuteNoSelect, getCall, getCalls, hasMultipleCalls, prepareReportQueryItems, selectResultSet, selectRowForDoesExist, setCall, setCalls, updateAll, updateAllUsingTempTables
-
Methods inherited from class org.eclipse.persistence.internal.queries.DatabaseQueryMechanism
addWriteLockFieldForInsert, buildSelectionCriteria, clone, executeWrite, executeWriteWithChangeSet, getDescriptor, getExecutionSession, getModifyRow, getQuery, getReadObjectQuery, getSession, getTranslationRow, getWriteObjectQuery, insertObjectForWrite, isJPQLCallQueryMechanism, isQueryByExampleMechanism, performUserDefinedInsert, performUserDefinedUpdate, performUserDefinedWrite, registerObjectInIdentityMap, setQuery, shallowInsertObjectForWrite, updateForeignKeyFieldAfterInsert, updateObjectAndRowWithReturnRow, updateObjectAndRowWithSequenceNumber, updateObjectAndRowWithSequenceNumber, updateObjectForWrite, updateObjectForWriteWithChangeSet
-
-
-
-
Field Detail
-
selectionCriteria
protected Expression selectionCriteria
-
-
Constructor Detail
-
ExpressionQueryMechanism
public ExpressionQueryMechanism()
-
ExpressionQueryMechanism
public ExpressionQueryMechanism(DatabaseQuery query)
Initialize the state of the query- Parameters:
query- - owner of mechanism
-
ExpressionQueryMechanism
public ExpressionQueryMechanism(DatabaseQuery query, Expression expression)
Initialize the state of the query- Parameters:
query- - owner of mechanismexpression- - selection criteria
-
-
Method Detail
-
aliasFields
protected Vector aliasFields(ObjectExpression node, Vector fields)
Alias the supplied fields with respect to the expression node. Return copies of the fields
-
aliasPresetFields
public Vector aliasPresetFields(SQLSelectStatement statement)
If the fields in the statement have breen pre-set, e.g. for a subset of the fields in a partial attribute read, report query, or just a query for the class indicator, then try to alias those. Right now this just guesses that they're all from the base.
-
buildBaseSelectionCriteria
public Expression buildBaseSelectionCriteria(boolean isSubSelect, Map clonedExpressions)
Create the appropriate where clause. Since this is where the selection criteria gets cloned for the first time (long after the owning query has been) many interesting things happen here.
-
buildBaseSelectionCriteria
public Expression buildBaseSelectionCriteria(boolean isSubSelect, Map clonedExpressions, boolean shouldUseAdditionalJoinExpression)
Create the appropriate where clause. Since this is where the selection criteria gets cloned for the first time (long after the owning query has been) many interesting things happen here. Ability to switch off AdditionalJoinExpression is required for DeleteAllQuery.
-
buildBaseSelectStatement
public SQLSelectStatement buildBaseSelectStatement(boolean isSubSelect, Map clonedExpressions)
Return the appropriate select statement containing the fields in the table.
-
buildBaseSelectStatement
public SQLSelectStatement buildBaseSelectStatement(boolean isSubSelect, Map clonedExpressions, boolean shouldUseAdditionalJoinExpression)
Return the appropriate select statement containing the fields in the table. Ability to switch off AdditionalJoinExpression is required for DeleteAllQuery.
-
buildConcreteSelectStatement
protected SQLSelectStatement buildConcreteSelectStatement()
Return the appropriate select statement containing the fields in the table. This is used as a second read to a concrete class with subclasses in an abstract-multiple table read.
-
buildDeleteAllStatement
protected SQLDeleteStatement buildDeleteAllStatement(DatabaseTable table, Expression inheritanceExpression, SQLCall selectCallForExist, SQLSelectStatement selectStatementForExist, SQLCall selectCallForNotExist, SQLSelectStatement selectStatementForNotExist, Collection primaryKeyFields)
Return the appropriate delete statement Passing of a call/ statement pair is used because the same pair may be used several times. More elegant orangement of passing just a statement and creating the call in the method was rejected because the same call would've been potentially re-created several times. Preconditions: if selectCallForExist != null then selectStatementForExist != null; if selectCallForNotExist != null then selectStatementForNotExist != null.- Returns:
- SQLDeleteStatement
-
buildDeleteAllStatementForMapping
protected SQLDeleteStatement buildDeleteAllStatementForMapping(SQLCall selectCallForExist, SQLSelectStatement selectStatementForExist, Vector sourceFields, Vector targetFields)
Create SQLDeleteAllStatements for mappings that may be responsible for references to the objects to be deleted in the tables NOT mapped to any class: ManyToManyMapping and DirectCollectionMapping NOTE: A similar pattern also used in method buildDeleteAllStatementsForMappingsWithTempTable(): if you are updating this method consider applying a similar update to that method as well.- Returns:
Vector<SQLDeleteAllStatement>
-
buildDeleteAllStatementsForMappingsWithTempTable
protected Vector buildDeleteAllStatementsForMappingsWithTempTable(ClassDescriptor descriptor, DatabaseTable rootTable, boolean dontCheckDescriptor)
Build delete statements with temporary table for ManyToMany and DirectCollection mappings. NOTE: A similar pattern also used in method buildDeleteAllStatementsForMappings(): if you are updating this method consider applying a similar update to that method as well.- Returns:
Vector<SQLDeleteAllStatementForTempTable>
-
shouldBuildDeleteStatementForMapping
protected boolean shouldBuildDeleteStatementForMapping(ForeignReferenceMapping frMapping, boolean dontCheckDescriptor, ClassDescriptor descriptor)
-
getAliasTableName
protected static String getAliasTableName(SQLSelectStatement selectStatement, DatabaseTable table, DatasourcePlatform platform)
-
buildDeleteStatementForDeleteAllQuery
protected SQLDeleteStatement buildDeleteStatementForDeleteAllQuery(DatabaseTable table)
Used by DeleteAllQuery to create DeleteStatement in a simple case when selectionCriteria==null.
-
buildDeleteStatementForDeleteAllQuery
protected SQLDeleteStatement buildDeleteStatementForDeleteAllQuery(DatabaseTable table, Expression inheritanceExpression)
Used by DeleteAllQuery to create DeleteStatement in a simple case when selectionCriteria==null.
-
buildDeleteStatement
protected SQLDeleteStatement buildDeleteStatement(DatabaseTable table)
Return the appropriate delete statement
-
buildInsertStatement
protected SQLInsertStatement buildInsertStatement(DatabaseTable table)
Return the appropriate insert statement
-
buildNormalSelectStatement
protected SQLSelectStatement buildNormalSelectStatement()
Return the appropriate select statement containing the fields in the table.
-
shouldIncludeAllSubclassFields
protected boolean shouldIncludeAllSubclassFields(SQLSelectStatement selectStatement)
Return whether to include all subclass fields in select statement or not.
-
buildReportQuerySelectStatement
protected SQLSelectStatement buildReportQuerySelectStatement(boolean isSubSelect)
Return the appropriate select statement containing the fields in the table. Similar to super except the buildBaseSelectStatement will look after setting the fields to select.
-
buildReportQuerySelectStatement
protected SQLSelectStatement buildReportQuerySelectStatement(boolean isSubSelect, boolean useCustomaryInheritanceExpression, Expression inheritanceExpression, boolean shouldUseAdditionalJoinExpression)
Customary inheritance expression is required for DeleteAllQuery and UpdateAllQuery preparation. Ability to switch off AdditionalJoinExpression is required for DeleteAllQuery.
-
buildSelectStatementForDoesExist
protected SQLSelectStatement buildSelectStatementForDoesExist(DatabaseField field)
Return the appropriate select statement to perform a does exist check- Parameters:
field- fields for does exist check.
-
buildUpdateAllStatement
protected SQLUpdateAllStatement buildUpdateAllStatement(DatabaseTable table, HashMap databaseFieldsToValues, SQLCall selectCallForExist, SQLSelectStatement selectStatementForExist, Collection primaryKeyFields)
-
buildUpdateStatement
protected SQLUpdateStatement buildUpdateStatement(DatabaseTable table)
Return the appropriate update statement- Returns:
- SQLInsertStatement
-
checkCacheForObject
public Object checkCacheForObject(AbstractRecord translationRow, AbstractSession session)
Perform a cache lookup for the query This is only called from read object query. The query has already checked that the cache should be checked.- Overrides:
checkCacheForObjectin classDatabaseQueryMechanism
-
clearStatement
public void clearStatement()
The statement is no longer require after prepare so can be released.- Overrides:
clearStatementin classStatementQueryMechanism
-
clone
public DatabaseQueryMechanism clone(DatabaseQuery queryClone)
Clone the mechanism for the specified query clone. Should not try to clone statements.- Overrides:
clonein classStatementQueryMechanism
-
getExpressionBuilder
public ExpressionBuilder getExpressionBuilder()
Return an expression builder which is valid for us
-
getSelectionCriteria
public Expression getSelectionCriteria()
Return the selection criteria of the query.- Overrides:
getSelectionCriteriain classStatementQueryMechanism
-
getSelectionFields
public Vector getSelectionFields(SQLSelectStatement statement, boolean includeAllSubclassFields)
Return the fields required in the select clause. This must now be called after normalization, so it will get the aliased fields
-
isExpressionQueryMechanism
public boolean isExpressionQueryMechanism()
Return true if this is an expression query mechanism.- Overrides:
isExpressionQueryMechanismin classDatabaseQueryMechanism
-
isStatementQueryMechanism
public boolean isStatementQueryMechanism()
Return true if this is a statement query mechanism- Overrides:
isStatementQueryMechanismin classStatementQueryMechanism
-
prepare
public void prepare() throws QueryExceptionOverride super to do nothing.- Overrides:
preparein classStatementQueryMechanism- Throws:
QueryException
-
prepareCursorSelectAllRows
public void prepareCursorSelectAllRows()
Pre-build the SQL statement from the expression.- Overrides:
prepareCursorSelectAllRowsin classStatementQueryMechanism
-
prepareDeleteAll
public void prepareDeleteAll()
Pre-build the SQL statement from the expression.- Overrides:
prepareDeleteAllin classStatementQueryMechanism
-
prepareDeleteAll
protected void prepareDeleteAll(List<DatabaseTable> tablesToIgnore, boolean isWhereClauseRequired)
Pre-build the SQL statement from the expression. NOTE: A similar pattern also used in method buildDeleteAllStatementsForTempTable(): if you are updating this method consider applying a similar update to that method as well.
-
prepareDeleteAllUsingTempStorage
protected void prepareDeleteAllUsingTempStorage()
-
prepareDeleteAllUsingTempTables
protected void prepareDeleteAllUsingTempTables()
-
buildDeleteAllStatementsForMappings
protected Vector buildDeleteAllStatementsForMappings(SQLCall selectCallForExist, SQLSelectStatement selectStatementForExist, boolean dontCheckDescriptor)
NOTE: A similar pattern also used in method buildDeleteAllStatementsForMappingsWithTempTable: if you are updating this method consider applying a similar update to that method as well.- Returns:
Vector<SQLDeleteAllStatement>
-
createSQLSelectStatementForModifyAll
protected SQLSelectStatement createSQLSelectStatementForModifyAll(Expression whereClause)
-
createSQLSelectStatementForModifyAll
protected SQLSelectStatement createSQLSelectStatementForModifyAll(Expression whereClause, Expression inheritanceExpression, ClassDescriptor desc, boolean useCustomaryInheritanceExpression, boolean shouldUseAdditionalJoinExpression)
Customary inheritance expression is required for DeleteAllQuery and UpdateAllQuery preparation. Ability to switch off AdditionalJoinExpression is required for DeleteAllQuery.
-
createSQLSelectStatementForAssignedExpressionForUpdateAll
protected SQLSelectStatement createSQLSelectStatementForAssignedExpressionForUpdateAll(Expression value)
-
prepareDeleteObject
public void prepareDeleteObject()
Pre-build the SQL statement from the expression.- Overrides:
prepareDeleteObjectin classStatementQueryMechanism
-
prepareDoesExist
public void prepareDoesExist(DatabaseField field)
Pre-build the SQL statement from the expression.- Overrides:
prepareDoesExistin classStatementQueryMechanism
-
prepareInsertObject
public void prepareInsertObject()
Pre-build the SQL statement from the expression.- Overrides:
prepareInsertObjectin classStatementQueryMechanism
-
prepareReportQuerySelectAllRows
public void prepareReportQuerySelectAllRows()
Pre-build the SQL statement from the expression.- Overrides:
prepareReportQuerySelectAllRowsin classDatasourceCallQueryMechanism
-
prepareReportQuerySubSelect
public void prepareReportQuerySubSelect()
Pre-build the SQL statement from the expression. This is used for subselects, so does not normalize or generate the SQL as it needs the outer expression for this.- Overrides:
prepareReportQuerySubSelectin classDatasourceCallQueryMechanism
-
prepareSelectAllRows
public void prepareSelectAllRows()
Pre-build the SQL statement from the expression.- Overrides:
prepareSelectAllRowsin classStatementQueryMechanism
-
prepareSelectOneRow
public void prepareSelectOneRow()
Pre-build the SQL statement from the expression.- Overrides:
prepareSelectOneRowin classStatementQueryMechanism
-
prepareUpdateObject
public void prepareUpdateObject()
Pre-build the SQL statement from the expression.- Overrides:
prepareUpdateObjectin classStatementQueryMechanism
-
prepareUpdateAll
public void prepareUpdateAll()
Pre-build the SQL statement from the expressions.- Overrides:
prepareUpdateAllin classStatementQueryMechanism
-
createSQLSelectStatementForUpdateAllForOracleAnonymousBlock
protected SQLSelectStatement createSQLSelectStatementForUpdateAllForOracleAnonymousBlock(HashMap tables_databaseFieldsToValues)
-
createSQLSelectStatementForModifyAllForTempTable
protected SQLSelectStatement createSQLSelectStatementForModifyAllForTempTable(HashMap databaseFieldsToValues)
-
buildUpdateAllStatementForOracleAnonymousBlock
protected SQLModifyStatement buildUpdateAllStatementForOracleAnonymousBlock(HashMap tables_databaseFieldsToValues, HashMap tablesToPrimaryKeyFields)
-
prepareUpdateAllUsingTempStorage
protected void prepareUpdateAllUsingTempStorage(HashMap tables_databaseFieldsToValues, HashMap<DatabaseTable,List<DatabaseField>> tablesToPrimaryKeyFields)
-
prepareUpdateAllUsingOracleAnonymousBlock
protected void prepareUpdateAllUsingOracleAnonymousBlock(HashMap tables_databaseFieldsToValues, HashMap tablesToPrimaryKeyFields)
Pre-build the SQL statement from the expressions.
-
prepareUpdateAllUsingTempTables
protected void prepareUpdateAllUsingTempTables(HashMap tables_databaseFieldsToValues, HashMap<DatabaseTable,List<DatabaseField>> tablesToPrimaryKeyFields)
Pre-build the SQL statement from the expressions.
-
buildStatementsForDeleteAllForTempTables
protected Vector buildStatementsForDeleteAllForTempTables()
Build SQLStatements for delete all using temporary table.- Returns:
Vector<SQLStatement>
-
buildStatementsForUpdateAllForTempTables
protected Vector buildStatementsForUpdateAllForTempTables(DatabaseTable table, HashMap databaseFieldsToValues, List<DatabaseField> primaryKeyFields)
-
getPrimaryKeyFieldsForTable
protected List<DatabaseField> getPrimaryKeyFieldsForTable(DatabaseTable table)
-
getPrimaryKeyFieldsForTable
protected List<DatabaseField> getPrimaryKeyFieldsForTable(ClassDescriptor descriptor, DatabaseTable table)
-
selectAllReportQueryRows
public Vector selectAllReportQueryRows() throws DatabaseException
INTERNAL Read all rows from the database. The code to retrieve the full inheritance hierarchy was removed.- Overrides:
selectAllReportQueryRowsin classDatasourceCallQueryMechanism- Returns:
- Vector containing the database rows.
- Throws:
DatabaseException- - an error has occurred on the database.
-
selectAllRows
public Vector selectAllRows() throws DatabaseException
Read all rows from the database.- Overrides:
selectAllRowsin classDatasourceCallQueryMechanism- Returns:
- Vector containing the database rows.
- Throws:
DatabaseException- - an error has occurred on the database.
-
selectAllRowsFromConcreteTable
public Vector selectAllRowsFromConcreteTable() throws DatabaseException
Read all rows from the database. This is used only from query mechanism on a abstract-multiple table read.- Throws:
DatabaseException
-
selectAllRowsFromTable
public Vector selectAllRowsFromTable() throws DatabaseException
Read all rows from the database.- Returns:
- Vector containing the database rows.
- Throws:
DatabaseException- - an error has occurred on the database.
-
selectOneRow
public AbstractRecord selectOneRow() throws DatabaseException
Read a single row from the database. Create an SQL statement object, use it to create an SQL command string, and delegate row building responsibility to the accessor.- Overrides:
selectOneRowin classDatasourceCallQueryMechanism- Returns:
- row containing data
- Throws:
DatabaseException- - an error has occurred on the database
-
selectOneRowFromConcreteTable
public AbstractRecord selectOneRowFromConcreteTable() throws DatabaseException
Read a single row from the database. This is used from query mechanism during an abstract-multiple table read.- Throws:
DatabaseException
-
selectOneRowFromTable
public AbstractRecord selectOneRowFromTable() throws DatabaseException
Read a single row from the database. Create an SQL statement object, use it to create an SQL command string, and delegate row building responsibility to the accessor.- Throws:
DatabaseException
-
setSelectionCriteria
public void setSelectionCriteria(Expression expression)
Set the selection criteria of the query.
-
getHighestDescriptorMappingTable
protected ClassDescriptor getHighestDescriptorMappingTable(DatabaseTable table)
Pass to this method a table mapped by query's descriptor. Returns the highest descriptor in inheritance hierarchy that mapps this table.
-
-