public class PersistentObjectSet<E> extends RelationshipFault<E> implements Set<E>, ValueHolder<Object>, PersistentObjectCollection<E>
Modifier and Type | Field and Description |
---|---|
protected Set<E> |
addedToUnresolved |
protected Set<E> |
objectSet |
protected Set<E> |
removedFromUnresolved |
relationshipName, relationshipOwner
Constructor and Description |
---|
PersistentObjectSet(Persistent relationshipOwner,
String relationshipName) |
Modifier and Type | Method and Description |
---|---|
boolean |
add(E o) |
boolean |
addAll(Collection<? extends E> c) |
void |
addDirectly(E target)
Adds an object without triggering an event
|
void |
clear() |
boolean |
contains(Object o) |
boolean |
containsAll(Collection c) |
boolean |
equals(Object o) |
Set<E> |
getValue()
Returns an object stored by this ValueHolder.
|
Set<E> |
getValueDirectly()
Retrieves ValueHolder value without triggering fault resolution.
|
int |
hashCode() |
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() |
protected void |
mergeLocalChanges(List<E> resolved) |
protected void |
postprocessAdd(Collection<? extends E> collection) |
protected void |
postprocessAdd(E addedObject) |
protected void |
postprocessRemove(Collection<? extends E> collection) |
protected void |
postprocessRemove(E removedObject) |
boolean |
remove(Object o) |
boolean |
removeAll(Collection<?> c) |
void |
removeDirectly(E target)
Removes an object without triggering an event
|
protected Set<E> |
resolvedObjectSet()
Returns internal objects list resolving it if needed.
|
boolean |
retainAll(Collection<?> c) |
void |
setObjectSet(Set<E> objectSet) |
Object |
setValue(Object value)
Sets an object stored by this ValueHolder.
|
Object |
setValueDirectly(Object value)
Sets ValueHolder vaue without triggering fault resolution.
|
protected boolean |
shouldAddToRemovedFromUnresolvedSet(E object) |
int |
size() |
Object[] |
toArray() |
<T> T[] |
toArray(T[] a) |
String |
toString() |
getRelationshipName, getRelationshipOwner, isTransientParent, isUncommittedParent, resolveFromDB, updateReverse
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
spliterator
parallelStream, removeIf, stream
public PersistentObjectSet(Persistent relationshipOwner, String relationshipName)
public boolean isFault()
isFault
in interface ValueHolder<Object>
public void invalidate()
invalidate
in interface ValueHolder<Object>
public Object setValueDirectly(Object value) throws CayenneRuntimeException
ValueHolder
setValueDirectly
in interface ValueHolder<Object>
CayenneRuntimeException
public Set<E> getValue() throws CayenneRuntimeException
ValueHolder
getValue
in interface ValueHolder<Object>
CayenneRuntimeException
public Set<E> getValueDirectly() throws CayenneRuntimeException
ValueHolder
getValueDirectly
in interface ValueHolder<Object>
CayenneRuntimeException
public Object setValue(Object value) throws CayenneRuntimeException
ValueHolder
setValue
in interface ValueHolder<Object>
value
- a new value of the ValueHolder.CayenneRuntimeException
public boolean add(E o)
public boolean addAll(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 Set<E>
public boolean equals(Object o)
public int hashCode()
public boolean isEmpty()
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 Set<E> resolvedObjectSet()
protected void mergeLocalChanges(List<E> resolved)
mergeLocalChanges
in class RelationshipFault<E>
protected void postprocessAdd(Collection<? extends E> collection)
protected void postprocessRemove(Collection<? extends E> collection)
protected void postprocessAdd(E addedObject)
protected void postprocessRemove(E removedObject)
protected boolean shouldAddToRemovedFromUnresolvedSet(E object)
public void addDirectly(E target)
PersistentObjectCollection
addDirectly
in interface PersistentObjectCollection<E>
public void removeDirectly(E target)
PersistentObjectCollection
removeDirectly
in interface PersistentObjectCollection<E>
Copyright © 2001–2020 Apache Cayenne. All rights reserved.