|
Project Wonder 5.0 | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.webobjects.appserver.WODisplayGroup
er.extensions.appserver.ERXDisplayGroup<T>
er.extensions.batching.ERXBatchingDisplayGroup<T>
public class ERXBatchingDisplayGroup<T>
Extends WODisplayGroup
in order to provide real batching. This is
done by adding database specific code to the select statement from the
EOFetchSpecification
from the WODisplayGroup
's
EODataSource
which must be an EODatabaseDataSource
.
If used with other datasources, it reverts to the default behaviour.
Nested Class Summary | |
---|---|
static class |
ERXBatchingDisplayGroup.FakeArray
Dummy array class that is used to provide a certain number of entries. |
Nested classes/interfaces inherited from class com.webobjects.appserver.WODisplayGroup |
---|
com.webobjects.appserver.WODisplayGroup.Delegate |
Nested classes/interfaces inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
com.webobjects.foundation.NSKeyValueCoding._BooleanFieldBinding, com.webobjects.foundation.NSKeyValueCoding._BooleanMethodBinding, com.webobjects.foundation.NSKeyValueCoding._FieldBinding, com.webobjects.foundation.NSKeyValueCoding._ForwardingBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBinding, com.webobjects.foundation.NSKeyValueCoding._KeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding._MethodBinding, com.webobjects.foundation.NSKeyValueCoding._NumberFieldBinding, com.webobjects.foundation.NSKeyValueCoding._NumberMethodBinding, com.webobjects.foundation.NSKeyValueCoding._ReflectionKeyBindingCreation, com.webobjects.foundation.NSKeyValueCoding.DefaultImplementation, com.webobjects.foundation.NSKeyValueCoding.ErrorHandling, com.webobjects.foundation.NSKeyValueCoding.Null, com.webobjects.foundation.NSKeyValueCoding.UnknownKeyException, com.webobjects.foundation.NSKeyValueCoding.Utility, com.webobjects.foundation.NSKeyValueCoding.ValueAccessor |
Nested classes/interfaces inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving |
---|
com.webobjects.eocontrol.EOKeyValueArchiving._NullValueSupport, com.webobjects.eocontrol.EOKeyValueArchiving._NumberSupport, com.webobjects.eocontrol.EOKeyValueArchiving._TimestampSupport, com.webobjects.eocontrol.EOKeyValueArchiving.Awaking, com.webobjects.eocontrol.EOKeyValueArchiving.FinishInitialization, com.webobjects.eocontrol.EOKeyValueArchiving.Support |
Field Summary | |
---|---|
protected int |
_batchCount
total number of batches |
protected com.webobjects.foundation.NSArray<T> |
_displayedObjects
cache for the displayed objects |
protected java.lang.Boolean |
_isBatching
cache batching flag |
protected com.webobjects.foundation.NSArray<java.lang.String> |
_prefetchingRelationshipKeyPaths
|
protected int |
_rowCount
|
protected boolean |
_shouldRememberRowCount
|
Fields inherited from class com.webobjects.appserver.WODisplayGroup |
---|
DisplayGroupWillFetchNotification |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding |
---|
_CLASS, NullValue |
Fields inherited from interface com.webobjects.foundation.NSKeyValueCoding.ErrorHandling |
---|
_CLASS |
Fields inherited from interface com.webobjects.foundation.NSDisposable |
---|
_CLASS |
Fields inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving |
---|
_CLASS |
Fields inherited from interface com.webobjects.eocontrol.EOKeyValueArchiving.Awaking |
---|
_CLASS |
Constructor Summary | |
---|---|
ERXBatchingDisplayGroup()
Creates a new ERXBatchingDisplayGroup. |
Method Summary | |
---|---|
int |
batchCount()
Overridden to return the pre-calculated number of batches |
static java.lang.Object |
decodeWithKeyValueUnarchiver(com.webobjects.eocontrol.EOKeyValueUnarchiver unarchiver)
Decodes an ERXBatchingDisplayGroup from the given unarchiver. |
com.webobjects.foundation.NSArray<T> |
displayedObjects()
Overridden method in order to fetch -only- the rows that are needed. |
java.lang.Object |
fetch()
Overridden to fetch only within displayed limits. |
protected com.webobjects.eocontrol.EOFetchSpecification |
fetchSpecification()
Utility to get the fetch spec from the datasource and the filter qualifier. |
com.webobjects.foundation.NSArray<T> |
filteredObjects()
Overridden to return allObjects() when batching, as we can't qualify in memory. |
boolean |
hasMultipleBatches()
Overridden to refetchIfNecessary() first to ensure we get a correct result in cases where this is called before displayedObjects(). |
protected boolean |
isBatching()
Determines if batching is possible. |
boolean |
isRawRowsForCustomQueries()
Returns whether or not fetch specification with custom queries should use raw rows. |
protected com.webobjects.foundation.NSArray<T> |
objectsInRange(int start,
int end)
Utility to fetch the object in a given range. |
com.webobjects.foundation.NSArray<java.lang.String> |
prefetchingRelationshipKeyPaths()
Returns the prefetching key paths overriding those in the underlying fetch spec. |
protected void |
refetch()
Utility that does the actual fetching, if a qualifier() is set, it adds it to the dataSource() fetch qualifier. |
protected void |
refetchIfNecessary()
If we're batching and the displayed objects have not been fetched, do a refetch() of them. |
int |
rowCount()
Utility to get at the number of rows when batching. |
java.lang.Object |
selectFilteredObjects()
Selects the visible objects, overridden to fetch all objects. |
void |
setCurrentBatchIndex(int index)
Overriden to clear out our array of fetched objects. |
void |
setDataSource(com.webobjects.eocontrol.EODataSource eodatasource)
Overridden to set the isBatching flag to true if we have an EODatabaseDataSource. |
void |
setNumberOfObjectsPerBatch(int count)
Overriden to clear out our array of fetched objects. |
void |
setObjectArray(com.webobjects.foundation.NSArray objects)
Overridden to update the batch count. |
void |
setPrefetchingRelationshipKeyPaths(com.webobjects.foundation.NSArray<java.lang.String> prefetchingRelationshipKeyPaths)
Sets the prefetching key paths to override those in the underlying fetch spec. |
void |
setQualifier(com.webobjects.eocontrol.EOQualifier aEoqualifier)
Overridden to trigger a refetch. |
void |
setRawRowsForCustomQueries(boolean rawRowsForCustomQueries)
Sets whether or not fetch specification with custom queries should use raw rows. |
void |
setRowCount(int rowCount)
Override the number of rows of results (if you can provide a better estimate than the default behavior). |
void |
setShouldRememberRowCount(boolean shouldRememberRowCount)
Set to true to retain the rowCount() after it is determined once for a particular
qualifier. |
void |
setSortOrderings(com.webobjects.foundation.NSArray nsarray)
Overridden to preserve the selected objects. |
boolean |
shouldRememberRowCount()
|
protected void |
updateBatchCount()
|
void |
updateDisplayedObjects()
|
Methods inherited from class er.extensions.appserver.ERXDisplayGroup |
---|
allObjects, allQualifierOperators, clearExtraQualifiers, displayNextBatch, displayPreviousBatch, indexOfFirstDisplayedObject, indexOfLastDisplayedObject, qualifierFromQueryValues, selectedObject, selectedObjects, setQualifierForKey, setSelectedObjects, setSelectionIndexes, sortedObjects, sortOrderings |
Methods inherited from class com.webobjects.appserver.WODisplayGroup |
---|
_beginObserverNotification, _deleteObject, _insertObjectAtIndex, _lastObserverNotified, awakeFromKeyValueUnarchiver, clearSelection, currentBatchIndex, dataSource, defaultStringMatchFormat, defaultStringMatchOperator, delegate, delete, deleteObjectAtIndex, deleteSelection, detailKey, displayBatchContainingSelectedObject, dispose, editingContextPresentErrorMessage, encodeWithCoder, encodeWithKeyValueArchiver, endEditing, fetchesOnLoad, finishInitialization, globalDefaultForValidatesChangesImmediately, globalDefaultStringMatchFormat, globalDefaultStringMatchOperator, handleQueryWithUnboundKey, handleTakeValueForUnboundKey, hasDetailDataSource, initWithCoder, inQueryMode, insert, insertedObjectDefaultValues, insertNewObjectAtIndex, insertObjectAtIndex, localKeys, masterObject, numberOfObjectsPerBatch, objectsChangedInEditingContext, objectsInvalidatedInEditingContext, qualifier, qualifyDataSource, qualifyDisplayGroup, queryBindings, queryMatch, queryMax, queryMin, queryOperator, redisplay, relationalQualifierOperators, selectionIndexes, selectNext, selectObject, selectObjectsIdenticalTo, selectObjectsIdenticalToSelectFirstOnNoMatch, selectPrevious, selectsFirstObjectAfterFetch, setDefaultStringMatchFormat, setDefaultStringMatchOperator, setDelegate, setDetailKey, setFetchesOnLoad, setGlobalDefaultForValidatesChangesImmediately, setGlobalDefaultStringMatchFormat, setGlobalDefaultStringMatchOperator, setInQueryMode, setInsertedObjectDefaultValues, setLocalKeys, setMasterObject, setSelectedObject, setSelectsFirstObjectAfterFetch, setValidatesChangesImmediately, stringQualifierOperators, takeValueForKey, toString, unableToSetNullForKey, undoManager, validatesChangesImmediately, valueForKey, willChange |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
protected int _batchCount
protected com.webobjects.foundation.NSArray<T> _displayedObjects
protected java.lang.Boolean _isBatching
protected com.webobjects.foundation.NSArray<java.lang.String> _prefetchingRelationshipKeyPaths
protected int _rowCount
protected boolean _shouldRememberRowCount
Constructor Detail |
---|
public ERXBatchingDisplayGroup()
Method Detail |
---|
public void setRawRowsForCustomQueries(boolean rawRowsForCustomQueries)
rawRowsForCustomQueries
- whether or not fetch specification with custom queries should use raw rowspublic boolean isRawRowsForCustomQueries()
public static java.lang.Object decodeWithKeyValueUnarchiver(com.webobjects.eocontrol.EOKeyValueUnarchiver unarchiver)
unarchiver
- the unarchiver to construct this display group with
protected void refetchIfNecessary()
protected boolean isBatching()
public void setDataSource(com.webobjects.eocontrol.EODataSource eodatasource)
setDataSource
in class ERXDisplayGroup<T>
public int batchCount()
batchCount
in class com.webobjects.appserver.WODisplayGroup
public void setCurrentBatchIndex(int index)
setCurrentBatchIndex
in class com.webobjects.appserver.WODisplayGroup
public void setNumberOfObjectsPerBatch(int count)
setNumberOfObjectsPerBatch
in class ERXDisplayGroup<T>
public com.webobjects.foundation.NSArray<T> displayedObjects()
WODisplayGroup
would always fetch from the start until the end of the objects from the
fetch limit.
displayedObjects
in class ERXDisplayGroup<T>
public boolean hasMultipleBatches()
hasMultipleBatches
in class com.webobjects.appserver.WODisplayGroup
public com.webobjects.foundation.NSArray<T> filteredObjects()
filteredObjects
in class ERXDisplayGroup<T>
public void setQualifier(com.webobjects.eocontrol.EOQualifier aEoqualifier)
setQualifier
in class com.webobjects.appserver.WODisplayGroup
public void setSortOrderings(com.webobjects.foundation.NSArray nsarray)
setSortOrderings
in class ERXDisplayGroup<T>
public void setPrefetchingRelationshipKeyPaths(com.webobjects.foundation.NSArray<java.lang.String> prefetchingRelationshipKeyPaths)
prefetchingRelationshipKeyPaths
- the prefetching key paths to override those in the underlying fetch specpublic com.webobjects.foundation.NSArray<java.lang.String> prefetchingRelationshipKeyPaths()
protected com.webobjects.eocontrol.EOFetchSpecification fetchSpecification()
public int rowCount()
public void setRowCount(int rowCount)
rowCount
- the number of rows of resultspublic boolean shouldRememberRowCount()
true
if the rowCount() should be remembered after being determined
or false
if rowCount() should be re-calculated when the batch changespublic void setShouldRememberRowCount(boolean shouldRememberRowCount)
true
to retain the rowCount() after it is determined once for a particular
qualifier. Set to false
to have rowCount() re-calculated when the batch changes.
The default is true
.
shouldRememberRowCount
- the shouldRememberRowCount to setprotected com.webobjects.foundation.NSArray<T> objectsInRange(int start, int end)
start
- end
- protected void refetch()
protected void updateBatchCount()
public void setObjectArray(com.webobjects.foundation.NSArray objects)
setObjectArray
in class com.webobjects.appserver.WODisplayGroup
public java.lang.Object fetch()
fetch
in class ERXDisplayGroup<T>
public void updateDisplayedObjects()
updateDisplayedObjects
in class com.webobjects.appserver.WODisplayGroup
public java.lang.Object selectFilteredObjects()
selectFilteredObjects
in class ERXDisplayGroup<T>
|
Last updated: Tue, Feb 21, 2017 05:45 PM CET | |||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |