Package org.eclipse.persistence.queries
Class CursorPolicy
- java.lang.Object
-
- org.eclipse.persistence.internal.queries.ContainerPolicy
-
- org.eclipse.persistence.queries.CursorPolicy
-
- All Implemented Interfaces:
Serializable,Cloneable,org.eclipse.persistence.internal.core.queries.CoreContainerPolicy<org.eclipse.persistence.internal.sessions.AbstractSession>
- Direct Known Subclasses:
CursoredStreamPolicy,ScrollableCursorPolicy
public abstract class CursorPolicy extends org.eclipse.persistence.internal.queries.ContainerPolicyPurpose: Abstract class for all Cursor-related policy objects
- See Also:
- Serialized Form
-
-
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 org.eclipse.persistence.internal.queries.ContainerPolicyclone(ReadQuery query)INTERNAL:CollectionChangeEventcreateChangeEvent(Object collectionOwner, String propertyName, Object collectionChanged, Object elementChanged, int changeType, Integer index, boolean isChangeApplied)INTERNAL: Creates a CollectionChangeEvent for the containerabstract 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(Object iterator)INTERNAL: Return whether the iterator has more objects.booleanisCursorPolicy()ObjectiteratorFor(Object container)INTERNAL: Return an iterator for the given container.booleanoverridesRead()INTERNAL: This can be used by collection such as cursored stream to gain control over execution.voidprepare(DatabaseQuery query, org.eclipse.persistence.internal.sessions.AbstractSession session)INTERNAL: Prepare and validate.abstract 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(Object container)INTERNAL: Return the size of container.-
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, compareCollectionsForChange, compareKeys, concatenateContainers, containerInstance, containerInstance, contains, convertClassNamesToClasses, copyMapDataToRow, createWrappedObjectFromExistingWrappedObject, deleteWrappedObject, equals, getAdditionalFieldsForJoin, getAdditionalTablesForJoinQuery, getChangeValuesFrom, getCloneDataFromChangeSet, getContainerClass, getContainerClassName, getDefaultContainerClass, getDescriptorForMapKey, getElementDescriptor, getIdentityFieldsForMapKey, getKeyMappingDataForWriteQuery, getKeySelectionCriteria, getKeyType, hasElementDescriptor, hasOrder, initialize, initializeConstructor, isCollectionPolicy, isCursoredStreamPolicy, isDirectMapPolicy, isEmpty, isListPolicy, isMapKeyObject, isMappedKeyMapPolicy, isMapPolicy, isOrderedListPolicy, isScrollableCursorPolicy, isValidContainer, isValidContainerType, iterateOnMapKey, keyFrom, keyFromEntry, keyFromIterator, mergeCascadeParts, mergeChanges, next, nextEntry, nextEntry, postCalculateChanges, postCalculateChanges, postInitialize, prepareForExecution, processAdditionalWritableMapKeyFields, propagatesEventsToCollection, propogatePostDelete, propogatePostInsert, propogatePostUpdate, propogatePreDelete, propogatePreInsert, propogatePreUpdate, recordAddToCollectionInChangeRecord, recordPrivateOwnedRemovals, recordRemoveFromCollectionInChangeRecord, recordUpdateToCollectionInChangeRecord, removeFrom, removeFrom, requiresDataModificationEvents, setContainerClass, setContainerClassName, setDefaultContainerClass, setElementDescriptor, setKeyName, setKeyName, shouldAddAll, shouldIncludeKeyInDeleteEvent, shouldUpdateForeignKeysPostInsert, toString, unwrapElement, unwrapIteratorResult, updateChangeRecordForSelfMerge, updateJoinedMappingIndexesForMapKey, valueFromPKList, vectorFor
-
-
-
-
Constructor Detail
-
CursorPolicy
public CursorPolicy()
INTERNAL: default constructor
-
CursorPolicy
public CursorPolicy(ReadQuery query, int pageSize)
INTERNAL:
-
-
Method Detail
-
clone
public org.eclipse.persistence.internal.queries.ContainerPolicy clone(ReadQuery query)
INTERNAL:- Overrides:
clonein classorg.eclipse.persistence.internal.queries.ContainerPolicy
-
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:
createChangeEventin classorg.eclipse.persistence.internal.queries.ContainerPolicy
-
execute
public abstract Object execute()
INTERNAL: Execute the cursored select and build the stream.- Overrides:
executein classorg.eclipse.persistence.internal.queries.ContainerPolicy
-
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(Object iterator)
INTERNAL: Return whether the iterator has more objects.- Specified by:
hasNextin interfaceorg.eclipse.persistence.internal.core.queries.CoreContainerPolicy<org.eclipse.persistence.internal.sessions.AbstractSession>- Specified by:
hasNextin classorg.eclipse.persistence.internal.queries.ContainerPolicy- 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 classorg.eclipse.persistence.internal.queries.ContainerPolicy
-
iteratorFor
public Object iteratorFor(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 interfaceorg.eclipse.persistence.internal.core.queries.CoreContainerPolicy<org.eclipse.persistence.internal.sessions.AbstractSession>- Specified by:
iteratorForin classorg.eclipse.persistence.internal.queries.ContainerPolicy- See Also:
ContainerPolicy.hasNext(java.lang.Object),ContainerPolicy.next(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 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 classorg.eclipse.persistence.internal.queries.ContainerPolicy- Throws:
QueryException
-
remoteExecute
public abstract Object remoteExecute()
INTERNAL: Execute the cursored select and build the stream.- Overrides:
remoteExecutein classorg.eclipse.persistence.internal.queries.ContainerPolicy
-
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(Object container)
INTERNAL: Return the size of container.- Specified by:
sizeForin interfaceorg.eclipse.persistence.internal.core.queries.CoreContainerPolicy<org.eclipse.persistence.internal.sessions.AbstractSession>- Overrides:
sizeForin classorg.eclipse.persistence.internal.queries.ContainerPolicy
-
-