java.lang.Object
org.eclipse.persistence.internal.queries.ContainerPolicy
org.eclipse.persistence.queries.CursorPolicy
- All Implemented Interfaces:
Serializable
,Cloneable
,CoreContainerPolicy<AbstractSession>
- Direct Known Subclasses:
CursoredStreamPolicy
,ScrollableCursorPolicy
Purpose: Abstract class for all Cursor-related policy objects
- See Also:
-
Field Summary
Fields inherited from class org.eclipse.persistence.internal.queries.ContainerPolicy
constructor, defaultContainerClass, elementDescriptor
-
Constructor Summary
ModifierConstructorDescriptionprotected
INTERNAL: default constructorprotected
CursorPolicy
(ReadQuery query, int pageSize) INTERNAL: -
Method Summary
Modifier and TypeMethodDescriptionINTERNAL:createChangeEvent
(Object collectionOwner, String propertyName, Object collectionChanged, Object elementChanged, int changeType, Integer index, boolean isChangeApplied) INTERNAL: Creates a CollectionChangeEvent for the containerabstract Object
execute()
INTERNAL: Execute the cursored select and build the stream.int
Return the number of elements to be read into a cursored stream when more elements are needed from the database.getQuery()
INTERNAL: Return the query.boolean
INTERNAL: Return whether the iterator has more objects.boolean
iteratorFor
(Object container) INTERNAL: Return an iterator for the given container.protected Object
INTERNAL: Return the next object on the queue.boolean
INTERNAL: This can be used by collection such as cursored stream to gain control over execution.void
prepare
(DatabaseQuery query, AbstractSession session) INTERNAL: Prepare and validate.abstract Object
INTERNAL: Execute the cursored select and build the stream.void
setPageSize
(int pageSize) Set the number of elements to be read into a cursored stream when more elements are needed from the database.void
INTERNAL: Set the query.int
INTERNAL: Return the size of container.protected Object
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 Details
-
pageSize
protected int pageSize -
query
-
-
Constructor Details
-
CursorPolicy
protected CursorPolicy()INTERNAL: default constructor -
CursorPolicy
INTERNAL:
-
-
Method Details
-
clone
INTERNAL:- Overrides:
clone
in classContainerPolicy
-
createChangeEvent
public CollectionChangeEvent createChangeEvent(Object collectionOwner, String propertyName, Object collectionChanged, Object elementChanged, int changeType, Integer index, boolean isChangeApplied) INTERNAL: Creates a CollectionChangeEvent for the container- Specified by:
createChangeEvent
in classContainerPolicy
-
execute
INTERNAL: Execute the cursored select and build the stream.- Overrides:
execute
in 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
INTERNAL: Return the query. -
hasNext
INTERNAL: Return whether the iterator has more objects.- Specified by:
hasNext
in interfaceCoreContainerPolicy<AbstractSession>
- Specified by:
hasNext
in classContainerPolicy
- Parameters:
iterator
- java.lang.Object- Returns:
- boolean true if iterator has more objects
- See Also:
-
isCursorPolicy
public boolean isCursorPolicy()- Overrides:
isCursorPolicy
in classContainerPolicy
-
iteratorFor
INTERNAL: Return an iterator for the given container. This iterator can then be used as a parameter to #hasNext() and #next().- Specified by:
iteratorFor
in interfaceCoreContainerPolicy<AbstractSession>
- Specified by:
iteratorFor
in classContainerPolicy
- See Also:
-
next
INTERNAL: Return the next object on the queue. The iterator is the one returned from #iteratorFor().- Specified by:
next
in classContainerPolicy
- See Also:
-
overridesRead
public boolean overridesRead()INTERNAL: This can be used by collection such as cursored stream to gain control over execution.- Overrides:
overridesRead
in classContainerPolicy
-
prepare
INTERNAL: Prepare and validate.- Overrides:
prepare
in classContainerPolicy
- Throws:
QueryException
-
remoteExecute
INTERNAL: Execute the cursored select and build the stream.- Overrides:
remoteExecute
in 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
INTERNAL: Set the query. -
sizeFor
INTERNAL: Return the size of container.- Specified by:
sizeFor
in interfaceCoreContainerPolicy<AbstractSession>
- Overrides:
sizeFor
in classContainerPolicy
-
toStringInfo
- Overrides:
toStringInfo
in classContainerPolicy
-