public abstract class AbstractBeanCollection<E> extends Object implements BeanCollection<E>
BeanCollection.ModifyListenMode| Modifier and Type | Field and Description |
|---|---|
protected BeanCollectionTouched |
beanCollectionTouched |
protected String |
ebeanServerName |
protected Future<Integer> |
fetchFuture |
protected ExpressionList<?> |
filterMany |
protected boolean |
finishedFetch
Can be false when a background thread is used to continue the fetch the
rows.
|
protected boolean |
hasMoreRows
Flag set to true if rows are limited by firstRow maxRows and more rows
exist.
|
protected BeanCollectionLoader |
loader
The EbeanServer this is associated with.
|
protected int |
loaderIndex |
protected boolean |
modifyAddListening |
protected com.avaje.ebean.common.ModifyHolder<E> |
modifyHolder |
protected boolean |
modifyListening |
protected BeanCollection.ModifyListenMode |
modifyListenMode |
protected boolean |
modifyRemoveListening |
protected Object |
ownerBean
The owning bean (used for lazy fetch).
|
protected String |
propertyName
The name of this property in the owning bean (used for lazy fetch).
|
protected boolean |
readOnly |
| Constructor and Description |
|---|
AbstractBeanCollection()
Constructor not non-lazy loading collection.
|
AbstractBeanCollection(BeanCollectionLoader loader,
Object ownerBean,
String propertyName)
Used to create deferred fetch proxy.
|
| Modifier and Type | Method and Description |
|---|---|
void |
backgroundFetchWait()
Wait for the fetch to complete.
|
void |
backgroundFetchWait(long wait,
TimeUnit timeUnit)
Wait for the fetch to complete with a given timeout.
|
protected void |
checkReadOnly() |
ExpressionList<?> |
getFilterMany()
Return the filter (if any) that was used in building this collection.
|
int |
getLoaderIndex()
Return the index position of this collection in the lazy/query loader.
|
Set<E> |
getModifyAdditions()
Return the list of objects added to the list set or map.
|
protected com.avaje.ebean.common.ModifyHolder<E> |
getModifyHolder() |
BeanCollection.ModifyListenMode |
getModifyListenMode()
Return the modify listening mode this collection is using.
|
Set<E> |
getModifyRemovals()
Return the list of objects removed from the list set or map.
|
Object |
getOwnerBean()
Return the bean that owns this collection.
|
String |
getPropertyName()
Return the bean property name this collection represents.
|
boolean |
hasMoreRows()
Set to true if maxRows was hit and there are actually more rows available.
|
boolean |
isFinishedFetch()
Returns true if the fetch has finished.
|
boolean |
isReadOnly()
Return true if the collection should be treated as readOnly and no elements
can be added or removed etc.
|
protected void |
lazyLoadCollection(boolean onlyIds) |
void |
modifyAddition(E bean)
Add an object to the additions list.
|
void |
modifyRemoval(Object bean)
Add an object to the deletions list.
|
void |
modifyReset()
Reset the set of additions and deletions.
|
void |
setBackgroundFetch(Future<Integer> fetchFuture)
Set when this collection is being loaded via a background thread.
|
void |
setBeanCollectionTouched(BeanCollectionTouched notify)
Set a listener to be notified when the BeanCollection is first touched.
|
void |
setFilterMany(ExpressionList<?> filterMany)
Set the filter that was used in building this collection.
|
void |
setFinishedFetch(boolean finishedFetch)
Set to true when a fetch has finished.
|
void |
setHasMoreRows(boolean hasMoreRows)
Set to true when maxRows is hit but there are actually more rows available.
|
void |
setLoader(int beanLoaderIndex,
BeanCollectionLoader loader)
Set the loader that will be used to lazy/query load this collection.
|
void |
setModifyListening(BeanCollection.ModifyListenMode mode)
set modifyListening to be on or off.
|
void |
setReadOnly(boolean readOnly)
Set to true if you want the BeanCollection to be treated as read only.
|
protected void |
touched() |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitcheckEmptyLazyLoad, getActualCollection, getActualDetails, getActualEntries, internalAdd, isEmpty, isPopulated, isReference, sizeprotected boolean readOnly
protected transient BeanCollectionLoader loader
protected transient ExpressionList<?> filterMany
protected int loaderIndex
protected String ebeanServerName
protected transient BeanCollectionTouched beanCollectionTouched
protected final Object ownerBean
protected final String propertyName
protected boolean finishedFetch
protected boolean hasMoreRows
protected com.avaje.ebean.common.ModifyHolder<E> modifyHolder
protected BeanCollection.ModifyListenMode modifyListenMode
protected boolean modifyAddListening
protected boolean modifyRemoveListening
protected boolean modifyListening
public AbstractBeanCollection()
public AbstractBeanCollection(BeanCollectionLoader loader, Object ownerBean, String propertyName)
public Object getOwnerBean()
BeanCollectiongetOwnerBean in interface BeanCollection<E>public String getPropertyName()
BeanCollectiongetPropertyName in interface BeanCollection<E>public int getLoaderIndex()
BeanCollectionUsed for batch loading of collections.
getLoaderIndex in interface BeanCollection<E>public ExpressionList<?> getFilterMany()
BeanCollectionThis is so that the filter can be applied on refresh.
getFilterMany in interface BeanCollection<E>public void setFilterMany(ExpressionList<?> filterMany)
BeanCollectionsetFilterMany in interface BeanCollection<E>protected void lazyLoadCollection(boolean onlyIds)
protected void touched()
public void setBeanCollectionTouched(BeanCollectionTouched notify)
BeanCollectionsetBeanCollectionTouched in interface BeanCollection<E>public void setLoader(int beanLoaderIndex,
BeanCollectionLoader loader)
BeanCollectionsetLoader in interface BeanCollection<E>public boolean isReadOnly()
BeanCollectionisReadOnly in interface BeanCollection<E>public void setReadOnly(boolean readOnly)
BeanCollectionsetReadOnly in interface BeanCollection<E>public boolean hasMoreRows()
Can be used by client code that is paging through results using setFirstRow() setMaxRows(). If this returns true then the client can display a 'next' button etc.
hasMoreRows in interface BeanCollection<E>public void setHasMoreRows(boolean hasMoreRows)
setHasMoreRows in interface BeanCollection<E>public boolean isFinishedFetch()
isFinishedFetch in interface BeanCollection<E>public void setFinishedFetch(boolean finishedFetch)
setFinishedFetch in interface BeanCollection<E>public void setBackgroundFetch(Future<Integer> fetchFuture)
BeanCollection
Refer to Query.setBackgroundFetchAfter(int)
setBackgroundFetch in interface BeanCollection<E>public void backgroundFetchWait(long wait,
TimeUnit timeUnit)
BeanCollection
Refer to Query.setBackgroundFetchAfter(int)
backgroundFetchWait in interface BeanCollection<E>public void backgroundFetchWait()
BeanCollection
Refer to Query.setBackgroundFetchAfter(int)
backgroundFetchWait in interface BeanCollection<E>protected void checkReadOnly()
public void setModifyListening(BeanCollection.ModifyListenMode mode)
setModifyListening in interface BeanCollection<E>public BeanCollection.ModifyListenMode getModifyListenMode()
protected com.avaje.ebean.common.ModifyHolder<E> getModifyHolder()
public void modifyAddition(E bean)
BeanCollectionThis will potentially end up as an insert into a intersection table for a ManyToMany.
modifyAddition in interface BeanCollection<E>public void modifyRemoval(Object bean)
BeanCollectionThis will potentially end up as an delete from an intersection table for a ManyToMany.
modifyRemoval in interface BeanCollection<E>public void modifyReset()
BeanCollectionmodifyReset in interface BeanCollection<E>public Set<E> getModifyAdditions()
BeanCollectiongetModifyAdditions in interface BeanCollection<E>public Set<E> getModifyRemovals()
BeanCollectiongetModifyRemovals in interface BeanCollection<E>Copyright © 2014. All Rights Reserved.