org.eclipse.persistence.queries
Class ResultSetMappingQuery

java.lang.Object
  extended by org.eclipse.persistence.queries.DatabaseQuery
      extended by org.eclipse.persistence.queries.ReadQuery
          extended by org.eclipse.persistence.queries.ObjectBuildingQuery
              extended by org.eclipse.persistence.queries.ResultSetMappingQuery
All Implemented Interfaces:
Serializable, Cloneable

public class ResultSetMappingQuery
extends ObjectBuildingQuery

Purpose: Concrete class to perform read using raw SQL and the SQLResultSetMapping.

Responsibilities: Execute a selecting raw SQL string. Returns a List of results. Each item in the list will be another list consisting of the expected populated return types in the order they were specified in the SQLResultSetMapping

Since:
TopLink Java Essentials
Author:
Gordon Yorke
See Also:
SQLResultSetMapping, Serialized Form

Field Summary
 
Fields inherited from class org.eclipse.persistence.queries.ObjectBuildingQuery
DEFAULT_LOCK_MODE, LOCK, LOCK_NOWAIT, LOCK_RESULT_PROPERTY, NO_LOCK
 
Fields inherited from class org.eclipse.persistence.queries.DatabaseQuery
BATCH_FETCH_PROPERTY, CascadeAggregateDelete, CascadeAllParts, CascadeByMapping, CascadeDependentParts, CascadePrivateParts, NoCascading
 
Constructor Summary
ResultSetMappingQuery()
          PUBLIC: Initialize the state of the query.
ResultSetMappingQuery(Call call)
          PUBLIC: Initialize the query to use the specified call.
ResultSetMappingQuery(Call call, String sqlResultSetMappingName)
          PUBLIC: Initialize the query to use the specified call and SQLResultSetMapping
 
Method Summary
 void cacheResult(Object unwrappedOriginal)
          INTERNAL:
 Object clone()
          INTERNAL: Clone the query.
 void convertClassNamesToClasses(ClassLoader classLoader)
          INTERNAL: Convert all the class-name-based settings in this ResultSetMapping to actual class-based settings.
 Object executeDatabaseQuery()
          INTERNAL: Executes the prepared query on the datastore.
 SQLResultSetMapping getSQLResultSetMapping()
          PUBLIC: This will be the SQLResultSetMapping that is used by this query to process the database results
 String getSQLResultSetMappingName()
          PUBLIC: Return the result set mapping name.
 void setSQLResultSetMapping(SQLResultSetMapping resultSetMapping)
          PUBLIC: This will be the SQLResultSetMapping that is used by this query to process the database results
 void setSQLResultSetMappingName(String name)
          PUBLIC: This will be the SQLResultSetMapping that is used by this query to process the database results
 
Methods inherited from class org.eclipse.persistence.queries.ObjectBuildingQuery
copyFromQuery, deepClone, dontRefreshIdentityMapResult, dontRefreshRemoteIdentityMapResult, getDataResults, getEntityFetchGroup, getExecutionFetchGroup, getExecutionTime, getLockMode, getReferenceClass, getReferenceClassName, hasExecutionFetchGroup, hasPartialAttributeExpressions, isAttributeJoined, isClonePessimisticLocked, isDefaultLock, isLockQuery, isObjectBuildingQuery, isRegisteringResults, postRegisterIndividualResult, prepareFromQuery, recordCloneForPessimisticLocking, refreshIdentityMapResult, refreshRemoteIdentityMapResult, registerIndividualResult, setExecutionTime, setLockMode, setReferenceClass, setReferenceClassName, setShouldBuildNullForNullPk, setShouldRefreshIdentityMapResult, setShouldRefreshRemoteIdentityMapResult, setShouldRegisterResultsInUnitOfWork, setShouldUseExclusiveConnection, shouldBuildNullForNullPk, shouldReadAllMappings, shouldReadMapping, shouldRefreshIdentityMapResult, shouldRefreshRemoteIdentityMapResult, shouldRegisterResultsInUnitOfWork, shouldUseExclusiveConnection
 
Methods inherited from class org.eclipse.persistence.queries.ReadQuery
buildObject, cacheQueryResults, clearQueryResults, doNotCacheQueryResults, getFetchSize, getFirstResult, getMaxRows, getQueryId, getQueryResultsCachePolicy, getTemporaryCachedQueryResults, isDefaultPropertiesQuery, isReadQuery, prepareForExecution, remoteExecute, setFetchSize, setFirstResult, setMaxRows, setQueryId, setQueryResultsCachePolicy, setTemporaryCachedQueryResults, shouldCacheQueryResults
 
Methods inherited from class org.eclipse.persistence.queries.DatabaseQuery
addArgument, addArgument, addArgument, addArgumentByTypeName, addArgumentValue, addArgumentValues, addCall, addStatement, bindAllParameters, buildArgumentFields, cacheStatement, cascadeAllParts, cascadeByMapping, cascadeOnlyDependentParts, cascadePrivateParts, checkDescriptor, checkEarlyReturn, checkPrepare, checkPrepare, dontBindAllParameters, dontCacheStatement, dontCascadeParts, dontMaintainCache, execute, executeInUnitOfWork, extractRemoteResult, getAccessor, getArguments, getArgumentTypeNames, getArgumentTypes, getArgumentValues, getBatchObjects, getCall, getCascadePolicy, getDatasourceCall, getDatasourceCalls, getDescriptor, getDomainClassNounName, getDoNotRedirect, getEJBQLString, getExecutionSession, getFlushOnExecute, getHintString, getJPQLString, getName, getProperties, getProperty, getQueryMechanism, getQueryNounName, getQueryTimeout, getRedirector, getSelectionCriteria, getSensorName, getSession, getSessionName, getShouldBindAllParameters, getSourceMapping, getSQLStatement, getSQLString, getSQLStrings, getTranslatedSQLString, getTranslatedSQLStrings, getTranslationRow, hasAccessor, hasArguments, hasProperties, hasQueryMechanism, hasSessionName, ignoreBindAllParameters, ignoreCacheStatement, isCallQuery, isCascadeOfAggregateDelete, isCustomQueryUsed, isDataModifyQuery, isDataReadQuery, isDeleteAllQuery, isDeleteObjectQuery, isDirectReadQuery, isExecutionClone, isExpressionQuery, isInsertObjectQuery, isJPQLCallQuery, isModifyAllQuery, isModifyQuery, isNativeConnectionRequired, isObjectLevelModifyQuery, isObjectLevelReadQuery, isPrepared, isReadAllQuery, isReadObjectQuery, isReportQuery, isSQLCallQuery, isUpdateAllQuery, isUpdateObjectQuery, isUserDefined, isValueReadQuery, isWriteObjectQuery, maintainCache, prepareCall, redirectQuery, removeProperty, replaceValueHoldersIn, retrieveBypassCache, rowFromArguments, setAccessor, setArguments, setArgumentTypeNames, setArgumentTypes, setArgumentValues, setBatchObjects, setCall, setCascadePolicy, setDatasourceCall, setDescriptor, setDoNotRedirect, setEJBQLString, setFlushOnExecute, setHintString, setIsExecutionClone, setIsNativeConnectionRequired, setIsPrepared, setIsUserDefined, setJPQLString, setName, setProperties, setProperty, setQueryTimeout, setRedirector, setSelectionCriteria, setSession, setSessionName, setShouldBindAllParameters, setShouldBindAllParameters, setShouldCacheStatement, setShouldMaintainCache, setShouldPrepare, setShouldRetrieveBypassCache, setShouldStoreBypassCache, setShouldUseWrapperPolicy, setSourceMapping, setSQLStatement, setSQLString, setTranslationRow, shouldBindAllParameters, shouldCacheStatement, shouldCascadeAllParts, shouldCascadeByMapping, shouldCascadeOnlyDependentParts, shouldCascadeParts, shouldCascadePrivateParts, shouldCloneCall, shouldIgnoreBindAllParameters, shouldIgnoreCacheStatement, shouldMaintainCache, shouldPrepare, shouldRetrieveBypassCache, shouldStoreBypassCache, shouldUseWrapperPolicy, storeBypassCache, toString
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

ResultSetMappingQuery

public ResultSetMappingQuery()
PUBLIC: Initialize the state of the query.


ResultSetMappingQuery

public ResultSetMappingQuery(Call call)
PUBLIC: Initialize the query to use the specified call.


ResultSetMappingQuery

public ResultSetMappingQuery(Call call,
                             String sqlResultSetMappingName)
PUBLIC: Initialize the query to use the specified call and SQLResultSetMapping

Method Detail

cacheResult

public void cacheResult(Object unwrappedOriginal)
INTERNAL:

This method is called by the object builder when building an original. It will cause the original to be cached in the query results if the query is set to do so.

Specified by:
cacheResult in class ReadQuery

clone

public Object clone()
INTERNAL: Clone the query.

Overrides:
clone in class DatabaseQuery

convertClassNamesToClasses

public void convertClassNamesToClasses(ClassLoader classLoader)
INTERNAL: Convert all the class-name-based settings in this ResultSetMapping to actual class-based settings. This method is used when converting a project that has been built with class names to a project with classes.

Overrides:
convertClassNamesToClasses in class ObjectBuildingQuery
Parameters:
classLoader -

setSQLResultSetMapping

public void setSQLResultSetMapping(SQLResultSetMapping resultSetMapping)
PUBLIC: This will be the SQLResultSetMapping that is used by this query to process the database results


setSQLResultSetMappingName

public void setSQLResultSetMappingName(String name)
PUBLIC: This will be the SQLResultSetMapping that is used by this query to process the database results


executeDatabaseQuery

public Object executeDatabaseQuery()
                            throws DatabaseException
INTERNAL: Executes the prepared query on the datastore.

Specified by:
executeDatabaseQuery in class DatabaseQuery
Returns:
- the result of executing the query.
Throws:
DatabaseException - - an error has occurred on the database.

getSQLResultSetMapping

public SQLResultSetMapping getSQLResultSetMapping()
PUBLIC: This will be the SQLResultSetMapping that is used by this query to process the database results


getSQLResultSetMappingName

public String getSQLResultSetMappingName()
PUBLIC: Return the result set mapping name.