Package org.eclipse.persistence.queries
Class CursorPolicy
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.ContainerPolicy
-
- org.eclipse.persistence.queries.CursorPolicy
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable,CoreContainerPolicy<AbstractSession>
- Direct Known Subclasses:
CursoredStreamPolicy,ScrollableCursorPolicy
public abstract class CursorPolicy extends ContainerPolicy
Purpose: Abstract class for all Cursor-related policy objects
- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected intpageSizeprotected ReadQueryquery-
Fields inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
constructor, defaultContainerClass, elementDescriptor
-
-
Constructor Summary
Constructors Constructor Description CursorPolicy()INTERNAL: default constructorCursorPolicy(ReadQuery query, int pageSize)INTERNAL:
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description ContainerPolicyclone(ReadQuery query)INTERNAL:CollectionChangeEventcreateChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isChangeApplied)INTERNAL: Creates a CollectionChangeEvent for the containerabstract java.lang.Objectexecute()INTERNAL: Execute the cursored select and build the stream.intgetPageSize()Return the number of elements to be read into a cursored stream when more elements are needed from the database.ReadQuerygetQuery()INTERNAL: Return the query.booleanhasNext(java.lang.Object iterator)INTERNAL: Return whether the iterator has more objects.booleanisCursorPolicy()java.lang.ObjectiteratorFor(java.lang.Object container)INTERNAL: Return an iterator for the given container.protected java.lang.Objectnext(java.lang.Object iterator)INTERNAL: Return the next object on the queue.booleanoverridesRead()INTERNAL: This can be used by collection such as cursored stream to gain control over execution.voidprepare(DatabaseQuery query, AbstractSession session)INTERNAL: Prepare and validate.abstract java.lang.ObjectremoteExecute()INTERNAL: Execute the cursored select and build the stream.voidsetPageSize(int pageSize)Set the number of elements to be read into a cursored stream when more elements are needed from the database.voidsetQuery(ReadQuery query)INTERNAL: Set the query.intsizeFor(java.lang.Object container)INTERNAL: Return the size of container.protected java.lang.ObjecttoStringInfo()-
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, isCursoredStreamPolicy, 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
-
pageSize
protected int pageSize
-
query
protected ReadQuery query
-
-
Constructor Detail
-
CursorPolicy
public CursorPolicy()
INTERNAL: default constructor
-
CursorPolicy
public CursorPolicy(ReadQuery query, int pageSize)
INTERNAL:
-
-
Method Detail
-
clone
public ContainerPolicy clone(ReadQuery query)
INTERNAL:- Overrides:
clonein classContainerPolicy
-
createChangeEvent
public CollectionChangeEvent createChangeEvent(java.lang.Object collectionOwner, java.lang.String propertyName, java.lang.Object collectionChanged, java.lang.Object elementChanged, int changeType, java.lang.Integer index, boolean isChangeApplied)
INTERNAL: Creates a CollectionChangeEvent for the container- Specified by:
createChangeEventin classContainerPolicy
-
execute
public abstract java.lang.Object execute()
INTERNAL: Execute the cursored select and build the stream.- Overrides:
executein classContainerPolicy
-
getPageSize
public int getPageSize()
Return the number of elements to be read into a cursored stream when more elements are needed from the database.
-
getQuery
public ReadQuery getQuery()
INTERNAL: Return the query.
-
hasNext
public boolean hasNext(java.lang.Object iterator)
INTERNAL: Return whether the iterator has more objects.- Specified by:
hasNextin interfaceCoreContainerPolicy<AbstractSession>- Specified by:
hasNextin classContainerPolicy- Parameters:
iterator- java.lang.Object- Returns:
- boolean true if iterator has more objects
- See Also:
ContainerPolicy.iteratorFor(java.lang.Object)
-
isCursorPolicy
public boolean isCursorPolicy()
- Overrides:
isCursorPolicyin classContainerPolicy
-
iteratorFor
public java.lang.Object iteratorFor(java.lang.Object container)
INTERNAL: Return an iterator for the given container. This iterator can then be used as a parameter to #hasNext() and #next().- Specified by:
iteratorForin interfaceCoreContainerPolicy<AbstractSession>- Specified by:
iteratorForin classContainerPolicy- See Also:
ContainerPolicy.hasNext(java.lang.Object),ContainerPolicy.next(java.lang.Object)
-
next
protected java.lang.Object next(java.lang.Object iterator)
INTERNAL: Return the next object on the queue. The iterator is the one returned from #iteratorFor().- Specified by:
nextin classContainerPolicy- See Also:
ContainerPolicy.iteratorFor(java.lang.Object)
-
overridesRead
public boolean overridesRead()
INTERNAL: This can be used by collection such as cursored stream to gain control over execution.- Overrides:
overridesReadin classContainerPolicy
-
prepare
public void prepare(DatabaseQuery query, AbstractSession session) throws QueryException
INTERNAL: Prepare and validate.- Overrides:
preparein classContainerPolicy- Throws:
QueryException
-
remoteExecute
public abstract java.lang.Object remoteExecute()
INTERNAL: Execute the cursored select and build the stream.- Overrides:
remoteExecutein classContainerPolicy
-
setPageSize
public void setPageSize(int pageSize)
Set the number of elements to be read into a cursored stream when more elements are needed from the database.
-
setQuery
public void setQuery(ReadQuery query)
INTERNAL: Set the query.
-
sizeFor
public int sizeFor(java.lang.Object container)
INTERNAL: Return the size of container.- Specified by:
sizeForin interfaceCoreContainerPolicy<AbstractSession>- Overrides:
sizeForin classContainerPolicy
-
toStringInfo
protected java.lang.Object toStringInfo()
- Overrides:
toStringInfoin classContainerPolicy
-
-