E - the element type of the collectionpublic abstract class ManagedCollection<E> extends Object implements Serializable
| Constructor and Description |
|---|
ManagedCollection() |
ManagedCollection(PluralMapping<?,?,E> mapping,
ManagedInstance<?> managedInstance) |
| Modifier and Type | Method and Description |
|---|---|
abstract boolean |
addChild(EntryImpl<Object,ManagedInstance<?>> child)
Adds the child to the managed list without initialize checks.
|
abstract boolean |
addElement(EntryImpl<Object,?> child)
Adds the child to the managed list without initialize checks.
|
protected void |
changed()
Marks the collection as changed.
|
abstract void |
flush(Connection connection,
boolean removals,
boolean force)
Flushes the collection
|
abstract Collection<E> |
getDelegate()
Returns the delegate collection.
|
protected int |
getInsertBatchSize()
Returns the insertBatchSize of the ManagedCollection.
|
ManagedInstance<?> |
getManagedInstance()
Returns the managed instance of the managed collection.
|
protected PluralMapping<?,?,E> |
getMapping()
Returns the mapping of the managed collection.
|
protected abstract Collection<E> |
getSnapshot()
Return the items that are added.
|
abstract void |
initialize()
Initializes the managed collection.
|
abstract boolean |
isInitialized()
Returns if the list is initialized.
|
void |
mergeWith(EntityManagerImpl entityManager,
Object instance,
org.apache.commons.lang.mutable.MutableBoolean requiresFlush,
IdentityHashMap<Object,Object> processed)
Merges the collection with the entity
|
void |
persistAdditions(EntityManagerImpl entityManager)
Persists the entities that have been added to the collection.
|
abstract void |
refreshChildren()
Refreshes the children of the managed collection.
|
protected abstract void |
removeChild(E child)
Removes the child from the managed list without initialize checks.
|
protected boolean |
removed(Connection connection,
boolean removals) |
void |
removeOrphans(EntityManagerImpl entityManager)
Removes the entities that have been orphaned by removal from the collection.
|
protected void |
reset()
Clears the changed status.
|
protected abstract void |
snapshot()
Makes a snapshot of the collection
|
public ManagedCollection()
public ManagedCollection(PluralMapping<?,?,E> mapping, ManagedInstance<?> managedInstance)
mapping - the mappingmanagedInstance - the managed instancepublic abstract boolean addChild(EntryImpl<Object,ManagedInstance<?>> child)
child - the child to addpublic abstract boolean addElement(EntryImpl<Object,?> child)
child - the child to addprotected final void changed()
public abstract void flush(Connection connection, boolean removals, boolean force) throws SQLException
connection - the connectionremovals - true if the removals should be flushed and false for the additionsforce - true to force, effective only for insertions and for new entities.SQLException - thrown in case of an SQL errorpublic abstract Collection<E> getDelegate()
protected int getInsertBatchSize()
public ManagedInstance<?> getManagedInstance()
protected PluralMapping<?,?,E> getMapping()
protected abstract Collection<E> getSnapshot()
public abstract void initialize()
public abstract boolean isInitialized()
public void mergeWith(EntityManagerImpl entityManager, Object instance, org.apache.commons.lang.mutable.MutableBoolean requiresFlush, IdentityHashMap<Object,Object> processed)
entityManager - the entity managerinstance - the new entityrequiresFlush - if an implicit flush is requiredprocessed - registry of processed entitiespublic void persistAdditions(EntityManagerImpl entityManager)
entityManager - the entity managerpublic abstract void refreshChildren()
protected abstract void removeChild(E child)
child - the child to addprotected boolean removed(Connection connection, boolean removals) throws SQLException
connection - the connectionremovals - true if the removals should be flushed and false for the additionsSQLException - thrown in case of an SQL errorpublic void removeOrphans(EntityManagerImpl entityManager)
entityManager - the entity managerprotected void reset()
protected abstract void snapshot()
Copyright © 2012 Batoo Software & Consultancy. All Rights Reserved.