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.
-
-
Field Summary
Fields Modifier and Type Field Description protected EntityInstantiator
entityInstantiator
protected boolean
removed
protected Number
revision
-
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 void
addToCollection(T collection, Object collectionRow)
protected <R> R
doPrivileged(Supplier<R> block)
Perform an action in a privileged block.T
initialize()
protected abstract T
initializeCollection(int size)
protected <R> R
newObjectInstance(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:
initialize
in 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
-
-