Package org.eclipse.persistence.queries
Class CursoredStreamPolicy
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.ContainerPolicy
-
- org.eclipse.persistence.queries.CursorPolicy
-
- org.eclipse.persistence.queries.CursoredStreamPolicy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,org.eclipse.persistence.internal.core.queries.CoreContainerPolicy<org.eclipse.persistence.internal.sessions.AbstractSession>
public class CursoredStreamPolicy extends CursorPolicy
Purpose: Used to support cursored streams in a read query.
Responsibilities: Execute the cursored read and build the stream.
- See Also:
- Serialized Form
- Author:
- James Sutherland
- Since:
- TOPLink/Java 1.2
-
-
Field Summary
Fields Modifier and Type Field Description protected intinitialReadSizeprotected ValueReadQuerysizeQuery-
Fields inherited from class org.eclipse.persistence.queries.CursorPolicy
pageSize, query
-
-
Constructor Summary
Constructors Constructor Description CursoredStreamPolicy()default constructorCursoredStreamPolicy(ReadQuery query, int pageSize)set the initial read size to match the page sizeCursoredStreamPolicy(ReadQuery query, int initialReadSize, int pageSize)CursoredStreamPolicy(ReadQuery query, int initialReadSize, int pageSize, ValueReadQuery sizeQuery)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectexecute()INTERNAL: Execute the cursored select and build the stream.intgetInitialReadSize()Specifies the number of elements to be read initially into a cursored stream.ValueReadQuerygetSizeQuery()Return the query used to read the size.booleanhasSizeQuery()INTERNAL: Return if a custom size query is defined.booleanisCursoredStreamPolicy()voidprepare(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Prepare and validate.java.lang.ObjectremoteExecute()INTERNAL: Execute the cursored select and build the stream.voidsetInitialReadSize(int initialReadSize)Specifies the number of elements to be read initially into a cursored streamvoidsetSizeQuery(ValueReadQuery sizeQuery)Set the query used to read the size.-
Methods inherited from class org.eclipse.persistence.queries.CursorPolicy
clone, createChangeEvent, getPageSize, getQuery, hasNext, isCursorPolicy, iteratorFor, next, overridesRead, setPageSize, setQuery, sizeFor, toStringInfo
-
Methods inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
addAdditionalFieldsToQuery, addAll, addAll, addFieldsForMapKey, addInto, addInto, addInto, addInto, addNestedJoinsQueriesForMapKey, addNextValueFromIteratorInto, buildChangeSetForNewObjectInCollection, buildCloneForKey, buildCollectionEntry, buildContainerFromVector, buildDefaultPolicy, buildKey, buildKeyFromJoinedRow, buildPolicyFor, buildPolicyFor, buildReferencesPKList, buildSelectionQueryForDirectCollectionMapping, cascadeDiscoverAndPersistUnregisteredNewObjects, cascadePerformRemoveIfRequired, cascadeRegisterNewIfRequired, clear, clone, cloneFor, collectObjectForNewCollection, compareCollectionsForChange, compareKeys, concatenateContainers, containerInstance, containerInstance, contains, contains, convertClassNamesToClasses, copyMapDataToRow, createChangeSetForKeys, createWrappedObjectFromExistingWrappedObject, deleteWrappedObject, equals, getAdditionalFieldsForJoin, getAdditionalTablesForJoinQuery, getChangeValuesFrom, getCloneDataFromChangeSet, getConstructor, getContainerClass, getContainerClassName, getDefaultContainerClass, getDescriptorForMapKey, getElementDescriptor, getIdentityFieldsForMapKey, getKeyMappingDataForWriteQuery, getKeySelectionCriteria, getKeyType, hasElementDescriptor, hashCode, hasOrder, initialize, initializeConstructor, isCollectionPolicy, isDirectMapPolicy, isEmpty, isListPolicy, isMapKeyObject, isMappedKeyMapPolicy, isMapPolicy, isOrderedListPolicy, isScrollableCursorPolicy, isValidContainer, isValidContainerType, iterateOnMapKey, keyFrom, keyFromEntry, keyFromIterator, mergeCascadeParts, mergeChanges, mergeChanges, next, nextEntry, nextEntry, postCalculateChanges, postCalculateChanges, postInitialize, prepareForExecution, processAdditionalWritableMapKeyFields, propagatesEventsToCollection, propogatePostDelete, propogatePostInsert, propogatePostUpdate, propogatePreDelete, propogatePreInsert, propogatePreUpdate, recordAddToCollectionInChangeRecord, recordPrivateOwnedRemovals, recordRemoveFromCollectionInChangeRecord, recordUpdateToCollectionInChangeRecord, removeFrom, removeFrom, removeFrom, requiresDataModificationEvents, setConstructor, setContainerClass, setContainerClassName, setDefaultContainerClass, setElementDescriptor, setKeyName, setKeyName, shouldAddAll, shouldIncludeKeyInDeleteEvent, shouldUpdateForeignKeysPostInsert, toString, unwrapElement, unwrapIteratorResult, updateChangeRecordForSelfMerge, updateJoinedMappingIndexesForMapKey, valueFromPKList, vectorFor
-
-
-
-
Field Detail
-
initialReadSize
protected int initialReadSize
-
sizeQuery
protected ValueReadQuery sizeQuery
-
-
Constructor Detail
-
CursoredStreamPolicy
public CursoredStreamPolicy()
default constructor
-
CursoredStreamPolicy
public CursoredStreamPolicy(ReadQuery query, int pageSize)
set the initial read size to match the page size
-
CursoredStreamPolicy
public CursoredStreamPolicy(ReadQuery query, int initialReadSize, int pageSize)
-
CursoredStreamPolicy
public CursoredStreamPolicy(ReadQuery query, int initialReadSize, int pageSize, ValueReadQuery sizeQuery)
-
-
Method Detail
-
execute
public java.lang.Object execute()
INTERNAL: Execute the cursored select and build the stream.- Specified by:
executein classCursorPolicy
-
getInitialReadSize
public int getInitialReadSize()
Specifies the number of elements to be read initially into a cursored stream.
-
getSizeQuery
public ValueReadQuery getSizeQuery()
Return the query used to read the size. This is required for SQL read queries.
-
hasSizeQuery
public boolean hasSizeQuery()
INTERNAL: Return if a custom size query is defined.
-
isCursoredStreamPolicy
public boolean isCursoredStreamPolicy()
- Overrides:
isCursoredStreamPolicyin classorg.eclipse.persistence.internal.queries.ContainerPolicy
-
prepare
public void prepare(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session) throws QueryException
INTERNAL: Prepare and validate.- Overrides:
preparein classCursorPolicy- Throws:
QueryException
-
remoteExecute
public java.lang.Object remoteExecute()
INTERNAL: Execute the cursored select and build the stream.- Specified by:
remoteExecutein classCursorPolicy
-
setInitialReadSize
public void setInitialReadSize(int initialReadSize)
Specifies the number of elements to be read initially into a cursored stream
-
setSizeQuery
public void setSizeQuery(ValueReadQuery sizeQuery)
Set the query used to read the size. This is required for SQL read queries.
-
-