public class UnitOfWorkFactoryImpl extends Object implements UnitOfWorkFactory
UnitOfWorkFactoryLOG| Constructor and Description |
|---|
UnitOfWorkFactoryImpl(@NonNull Collection<org.hibernate.SessionFactory> sessionFactories) |
| Modifier and Type | Method and Description |
|---|---|
<T> Callable<T> |
create(Callable<T> callable)
Wraps a Callable into a unit of work.
|
Runnable |
create(Runnable runnable)
Wraps a Runnable into a unit of work.
|
void |
restart()
When called, this will close and reopen all Sessions attached
to the current thread.
|
UnitOfWork |
start()
Starts a new unit of work: opens all Sessions.
|
void |
stop()
Stops the unit of work: closes all Sessions.
|
public UnitOfWorkFactoryImpl(@NonNull
@NonNull Collection<org.hibernate.SessionFactory> sessionFactories)
public Runnable create(Runnable runnable)
create in interface UnitOfWorkFactoryrunnable - Original runnable instance.public <T> Callable<T> create(Callable<T> callable)
create in interface UnitOfWorkFactoryT - the result type of the method callcallable - Original callable instance.public UnitOfWork start()
start in interface UnitOfWorkFactorypublic void restart()
restart in interface UnitOfWorkFactorypublic void stop()
stop in interface UnitOfWorkFactoryCopyright © 2020. All rights reserved.