Interface UnitOfWorkFactory
- All Known Implementing Classes:
SimpleUnitOfWorkFactory,TransactionalUnitOfWorkFactory
- Functional Interface:
- This is a functional interface and can therefore be used as the assignment target for a lambda expression or method reference.
Factory for creating
UnitOfWork instances. Useful to create units of work that are bound to some context,
such as a database transaction.- Since:
- 5.0.0
- Author:
- Mateusz Nowak
-
Method Summary
Modifier and TypeMethodDescriptiondefault UnitOfWorkcreate()Creates a newUnitOfWorkwith a randomly generated identifier.default UnitOfWorkCreates a newUnitOfWorkwith the given identifier.create(String identifier, Function<UnitOfWorkConfiguration, UnitOfWorkConfiguration> customization) Creates a newUnitOfWorkwith the given identifier and applies the provided customization to its configuration.default UnitOfWorkcreate(Function<UnitOfWorkConfiguration, UnitOfWorkConfiguration> customization) Creates a newUnitOfWorkwith a random identifier and applies the provided customization to its configuration.
-
Method Details
-
create
Creates a newUnitOfWorkwith a randomly generated identifier.- Returns:
- A new
UnitOfWorkinstance.
-
create
Creates a newUnitOfWorkwith the given identifier.- Parameters:
identifier- The identifier for the unit of work.- Returns:
- A new
UnitOfWorkinstance.
-
create
UnitOfWork create(String identifier, Function<UnitOfWorkConfiguration, UnitOfWorkConfiguration> customization) Creates a newUnitOfWorkwith the given identifier and applies the provided customization to its configuration.- Parameters:
identifier- The identifier for the unit of work.customization- A function to customize the unit of work's configuration.- Returns:
- A new
UnitOfWorkinstance.
-
create
Creates a newUnitOfWorkwith a random identifier and applies the provided customization to its configuration.- Parameters:
customization- A function to customize the unit of work's configuration.- Returns:
- A new
UnitOfWorkinstance.
-