Class AbstractCollectionInitializor<T>
- java.lang.Object
-
- org.hibernate.envers.internal.entities.mapper.relation.lazy.initializor.AbstractCollectionInitializor<T>
-
- All Implemented Interfaces:
Initializor<T>
- Direct Known Subclasses:
ArrayCollectionInitializor,BasicCollectionInitializor,ListCollectionInitializor,MapCollectionInitializor
public abstract class AbstractCollectionInitializor<T> extends Object implements Initializor<T>
Initializes a persistent collection.- Author:
- Adam Warski (adam at warski dot org)
-
-
Field Summary
Fields Modifier and Type Field Description protected EntityInstantiatorentityInstantiatorprotected booleanremovedprotected Numberrevision
-
Constructor Summary
Constructors Constructor Description AbstractCollectionInitializor(EnversService enversService, AuditReaderImplementor versionsReader, RelationQueryGenerator queryGenerator, Object primaryKey, Number revision, boolean removed)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description protected abstract voidaddToCollection(T collection, Object collectionRow)protected <R> RdoPrivileged(Supplier<R> block)Perform an action in a privileged block.Tinitialize()protected abstract TinitializeCollection(int size)protected <R> RnewObjectInstance(Class<R> clazz, Object... args)Creates a new object based on the specified class with the given constructor arguments.
-
-
-
Field Detail
-
revision
protected final Number revision
-
removed
protected final boolean removed
-
entityInstantiator
protected final EntityInstantiator entityInstantiator
-
-
Constructor Detail
-
AbstractCollectionInitializor
public AbstractCollectionInitializor(EnversService enversService, AuditReaderImplementor versionsReader, RelationQueryGenerator queryGenerator, Object primaryKey, Number revision, boolean removed)
-
-
Method Detail
-
initializeCollection
protected abstract T initializeCollection(int size)
-
initialize
public T initialize()
- Specified by:
initializein interfaceInitializor<T>
-
doPrivileged
protected <R> R doPrivileged(Supplier<R> block)
Perform an action in a privileged block.- Type Parameters:
R- the return type- Parameters:
block- the lambda to executed in privileged.- Returns:
- the result of the privileged call, may be null
-
newObjectInstance
protected <R> R newObjectInstance(Class<R> clazz, Object... args)
Creates a new object based on the specified class with the given constructor arguments.- Type Parameters:
R- the return class type- Parameters:
clazz- the class, must not be nullargs- the variadic constructor arguments, may be omitted.- Returns:
- a new instance of the class
-
-