public class PersistentObjectList<E> extends RelationshipFault<E> implements List<E>, ValueHolder<List<E>>, PersistentObjectCollection<E>
Modifier and Type | Field and Description |
---|---|
protected LinkedList<E> |
addedToUnresolved |
protected List<E> |
objectList |
protected LinkedList<E> |
removedFromUnresolved |
relationshipName, relationshipOwner
Constructor and Description |
---|
PersistentObjectList(Persistent relationshipOwner,
String relationshipName)
Creates PersistentObjectList initializing it with list owner persistent object and
relationship name that this list maps to.
|
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o) |
void |
add(int index,
E o) |
boolean |
addAll(Collection<? extends E> c) |
boolean |
addAll(int index,
Collection<? extends E> c) |
void |
addDirectly(E target)
Adds an object without triggering an event
|
protected boolean |
addLocal(E object) |
void |
clear() |
protected void |
clearLocalChanges() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection c) |
boolean |
equals(Object o) |
E |
get(int index) |
List<E> |
getValue()
Returns an object stored by this ValueHolder.
|
List<E> |
getValueDirectly()
Retrieves ValueHolder value without triggering fault resolution.
|
int |
hashCode() |
int |
indexOf(Object o) |
void |
invalidate()
Turns itself into a fault, thus forcing a refresh on the next access.
|
boolean |
isEmpty() |
boolean |
isFault()
Returns whether this list is not yet resolved and requires a fetch.
|
Iterator<E> |
iterator() |
int |
lastIndexOf(Object o) |
ListIterator<E> |
listIterator() |
ListIterator<E> |
listIterator(int index) |
protected void |
mergeLocalChanges(List<E> fetchedList) |
protected void |
postprocessAdd(Collection<? extends E> collection) |
protected void |
postprocessAdd(E addedObject) |
protected void |
postprocessRemove(Collection<? extends E> collection) |
protected void |
postprocessRemove(E removedObject) |
E |
remove(int index) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
void |
removeDirectly(E target)
Removes an object without triggering an event
|
protected boolean |
removeLocal(E object) |
protected List<E> |
resolvedObjectList()
Returns internal objects list resolving it if needed.
|
boolean |
retainAll(Collection c) |
E |
set(int index,
E o) |
void |
setObjectList(List<E> objectList) |
List<E> |
setValue(List<E> value)
Sets an object stored by this ValueHolder.
|
List<E> |
setValueDirectly(List<E> value)
Sets ValueHolder vaue without triggering fault resolution.
|
protected boolean |
shouldAddToRemovedFromUnresolvedList(Object object) |
int |
size() |
List<E> |
subList(int fromIndex,
int toIndex) |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB, updateReverse
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
replaceAll, sort, spliterator
parallelStream, removeIf, stream
protected LinkedList<E> addedToUnresolved
protected LinkedList<E> removedFromUnresolved
public PersistentObjectList(Persistent relationshipOwner, String relationshipName)
relationshipOwner
- persistent object that owns this list.relationshipName
- a query used to resolve the listpublic boolean isFault()
isFault
in interface ValueHolder<List<E>>
public void invalidate()
invalidate
in interface ValueHolder<List<E>>
public List<E> setValueDirectly(List<E> value) throws CayenneRuntimeException
ValueHolder
setValueDirectly
in interface ValueHolder<List<E>>
CayenneRuntimeException
public List<E> getValue() throws CayenneRuntimeException
ValueHolder
getValue
in interface ValueHolder<List<E>>
CayenneRuntimeException
public List<E> getValueDirectly() throws CayenneRuntimeException
ValueHolder
getValueDirectly
in interface ValueHolder<List<E>>
CayenneRuntimeException
public List<E> setValue(List<E> value) throws CayenneRuntimeException
ValueHolder
setValue
in interface ValueHolder<List<E>>
value
- a new value of the ValueHolder.CayenneRuntimeException
public boolean add(E o)
public boolean addAll(Collection<? extends E> c)
public boolean addAll(int index, Collection<? extends E> c)
public void clear()
public boolean contains(Object o)
public boolean containsAll(Collection c)
containsAll
in interface Collection<E>
containsAll
in interface List<E>
public boolean equals(Object o)
public int hashCode()
public boolean isEmpty()
public int lastIndexOf(Object o)
lastIndexOf
in interface List<E>
public ListIterator<E> listIterator()
listIterator
in interface List<E>
public ListIterator<E> listIterator(int index)
listIterator
in interface List<E>
public boolean remove(Object o)
public boolean removeAll(Collection<?> c)
public boolean retainAll(Collection c)
public int size()
public Object[] toArray()
public <T> T[] toArray(T[] a)
protected List<E> resolvedObjectList()
protected void clearLocalChanges()
protected void mergeLocalChanges(List<E> fetchedList)
mergeLocalChanges
in class RelationshipFault<E>
protected boolean addLocal(E object)
protected boolean removeLocal(E object)
protected boolean shouldAddToRemovedFromUnresolvedList(Object object)
removedFromUnresolved
during
removalprotected void postprocessAdd(Collection<? extends E> collection)
protected void postprocessRemove(Collection<? extends E> collection)
protected void postprocessAdd(E addedObject)
protected void postprocessRemove(E removedObject)
public void addDirectly(E target)
PersistentObjectCollection
addDirectly
in interface PersistentObjectCollection<E>
public void removeDirectly(E target)
PersistentObjectCollection
removeDirectly
in interface PersistentObjectCollection<E>
Copyright © 2001–2019 Apache Cayenne. All rights reserved.