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 ExpressionList<?> |
filterMany |
protected BeanCollectionLoader |
loader
The EbeanServer this is associated with.
|
protected boolean |
modifyAddListening |
protected com.avaje.ebean.common.ModifyHolder<E> |
modifyHolder |
protected boolean |
modifyListening |
protected BeanCollection.ModifyListenMode |
modifyListenMode |
protected boolean |
modifyRemoveListening |
protected EntityBean |
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 |
protected boolean |
registeredWithLoadContext
Flag set when registered with the batch loading context.
|
protected boolean |
touched
Flag used to tell if empty collections have been cleared etc or just
uninitialised.
|
| Constructor and Description |
|---|
AbstractBeanCollection()
Constructor not non-lazy loading collection.
|
AbstractBeanCollection(BeanCollectionLoader loader,
EntityBean ownerBean,
String propertyName)
Used to create deferred fetch proxy.
|
| Modifier and Type | Method and Description |
|---|---|
protected void |
checkReadOnly() |
ExpressionList<?> |
getFilterMany()
Return the filter (if any) that was used in building this collection.
|
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.
|
EntityBean |
getOwnerBean()
Return the bean that owns this collection.
|
String |
getPropertyName()
Return the bean property name this collection represents.
|
boolean |
isReadOnly()
Return true if the collection should be treated as readOnly and no elements
can be added or removed etc.
|
boolean |
isRegisteredWithLoadContext()
Return true if the collection has been registered with the batch loading context.
|
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 |
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 |
setLoader(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(boolean setFlag)
Set touched.
|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitaddBean, checkEmptyLazyLoad, getActualDetails, getActualEntries, internalAdd, internalAddWithCheck, isEmpty, isEmptyAndUntouched, isPopulated, isReference, loadFrom, removeBean, reset, sizeprotected boolean readOnly
protected transient BeanCollectionLoader loader
protected transient ExpressionList<?> filterMany
protected boolean registeredWithLoadContext
protected String ebeanServerName
protected transient BeanCollectionTouched beanCollectionTouched
protected EntityBean ownerBean
protected String propertyName
protected com.avaje.ebean.common.ModifyHolder<E> modifyHolder
protected BeanCollection.ModifyListenMode modifyListenMode
protected boolean modifyAddListening
protected boolean modifyRemoveListening
protected boolean modifyListening
protected boolean touched
public AbstractBeanCollection()
public AbstractBeanCollection(BeanCollectionLoader loader, EntityBean ownerBean, String propertyName)
public EntityBean getOwnerBean()
BeanCollectiongetOwnerBean in interface BeanCollection<E>public String getPropertyName()
BeanCollectiongetPropertyName 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(boolean setFlag)
public void setBeanCollectionTouched(BeanCollectionTouched notify)
BeanCollectionsetBeanCollectionTouched in interface BeanCollection<E>public boolean isRegisteredWithLoadContext()
BeanCollectionisRegisteredWithLoadContext in interface BeanCollection<E>public void setLoader(BeanCollectionLoader loader)
BeanCollectionThis is effectively the batch loading context this collection is registered with.
setLoader in interface BeanCollection<E>public boolean isReadOnly()
BeanCollectionisReadOnly in interface BeanCollection<E>public void setReadOnly(boolean readOnly)
BeanCollectionsetReadOnly 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 © 2016. All rights reserved.