com.wideplay.warp.persist.internal
Class PersistenceServiceBuilderImpl
java.lang.Object
com.wideplay.warp.persist.internal.PersistenceServiceBuilderImpl
- All Implemented Interfaces:
- PersistenceModuleBuilder, SessionStrategyBuilder, TransactionStrategyBuilder
@NotThreadSafe
public class PersistenceServiceBuilderImpl
- extends Object
- implements SessionStrategyBuilder, PersistenceModuleBuilder, TransactionStrategyBuilder
Configures and builds a Module for use in a Guice injector to enable the PersistenceService.
see the website for the EDSL binder language.
- Since:
- 1.0
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
PersistenceServiceBuilderImpl
public PersistenceServiceBuilderImpl(PersistenceFlavor flavor,
PersistenceModuleVisitor persistenceModuleVisitor)
PersistenceServiceBuilderImpl
public PersistenceServiceBuilderImpl(PersistenceStrategy persistenceStrategy,
PersistenceModuleVisitor persistenceModuleVisitor)
across
public TransactionStrategyBuilder across(UnitOfWork unitOfWork)
- Specified by:
across
in interface SessionStrategyBuilder
buildModule
public com.google.inject.Module buildModule()
- Specified by:
buildModule
in interface PersistenceModuleBuilder
addAccessor
public TransactionStrategyBuilder addAccessor(Class<?> daoInterface)
- Specified by:
addAccessor
in interface TransactionStrategyBuilder
- Parameters:
daoInterface
- An interface with some methods (typically all) that are
annotated with @Finder
. Warp-persist will automagically create method bodies
and provide an instance when you inject this interface anywhere in your setup.
Note that you are *not* allowed to provide your own implementation/binding for such
interfaces. Binding errors will result if you try.
Also accepts abstract classes, with one or more abstract methods marked @Finder
.
- Returns:
- Returns the next step in the builder chain
forAll
public TransactionStrategyBuilder forAll(com.google.inject.matcher.Matcher<? super Class<?>> classMatcher)
- Description copied from interface:
TransactionStrategyBuilder
- This is a convenience method, and defaults to using the method matcher:
Matchers.annotatedWith(Transactional.class)
.
- Specified by:
forAll
in interface TransactionStrategyBuilder
- Parameters:
classMatcher
- A Matcher
on classes to watch for transactional methods
- Returns:
- Returns the next step in the builder chain
forAll
public TransactionStrategyBuilder forAll(com.google.inject.matcher.Matcher<? super Class<?>> classMatcher,
com.google.inject.matcher.Matcher<? super Method> methodMatcher)
- Description copied from interface:
TransactionStrategyBuilder
- Note that if you do not have an
@Transactional
annotation present on transactional methods, and
use a Matcher.any()
for methods, warp-persist
will assume default rollbackOn and exceptOn clauses (as though @Transactional were present but
with no attributes specified).
- Specified by:
forAll
in interface TransactionStrategyBuilder
- Parameters:
classMatcher
- A Matcher on classes to watch for transactional methodsmethodMatcher
- A Matcher on methods
- Returns:
- Returns the next step in the builder chain