Class BindableRuleBasedTransactionAttribute
java.lang.Object
org.springframework.transaction.support.DefaultTransactionDefinition
org.springframework.transaction.interceptor.DefaultTransactionAttribute
io.micronaut.spring.tx.annotation.BindableRuleBasedTransactionAttribute
- All Implemented Interfaces:
Serializable
,org.springframework.transaction.interceptor.TransactionAttribute
,org.springframework.transaction.TransactionDefinition
public class BindableRuleBasedTransactionAttribute
extends org.springframework.transaction.interceptor.DefaultTransactionAttribute
Extends
RuleBasedTransactionAttribute
so that it can be bound
from annotation metadata and defaults to rollback on all exception types apart from those configured.- Since:
- 1.0
- Author:
- graemerocher
- See Also:
-
Field Summary
Fields inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
PREFIX_ISOLATION, PREFIX_PROPAGATION, PREFIX_TIMEOUT, READ_ONLY_MARKER
Fields inherited from interface org.springframework.transaction.TransactionDefinition
ISOLATION_DEFAULT, ISOLATION_READ_COMMITTED, ISOLATION_READ_UNCOMMITTED, ISOLATION_REPEATABLE_READ, ISOLATION_SERIALIZABLE, PROPAGATION_MANDATORY, PROPAGATION_NESTED, PROPAGATION_NEVER, PROPAGATION_NOT_SUPPORTED, PROPAGATION_REQUIRED, PROPAGATION_REQUIRES_NEW, PROPAGATION_SUPPORTS, TIMEOUT_DEFAULT
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfinal boolean
rollbackOn
(Throwable ex) final void
setNoRollbackFor
(Class<? extends Throwable>... exceptions) Configures the exceptions to not rollback for.final void
setRollbackFor
(Class<? extends Throwable>... exceptions) Configures the exceptions to rollback for.Methods inherited from class org.springframework.transaction.interceptor.DefaultTransactionAttribute
getAttributeDescription, getDescriptor, getLabels, getQualifier, getTimeoutString, resolveAttributeStrings, setDescriptor, setLabels, setQualifier, setTimeoutString
Methods inherited from class org.springframework.transaction.support.DefaultTransactionDefinition
equals, getDefinitionDescription, getIsolationLevel, getName, getPropagationBehavior, getTimeout, hashCode, isReadOnly, setIsolationLevel, setIsolationLevelName, setName, setPropagationBehavior, setPropagationBehaviorName, setReadOnly, setTimeout, toString
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
Methods inherited from interface org.springframework.transaction.TransactionDefinition
getIsolationLevel, getName, getPropagationBehavior, getTimeout, isReadOnly
-
Constructor Details
-
BindableRuleBasedTransactionAttribute
public BindableRuleBasedTransactionAttribute()
-
-
Method Details
-
setNoRollbackFor
Configures the exceptions to not rollback for.- Parameters:
exceptions
- The exceptions not to rollback for
-
setRollbackFor
Configures the exceptions to rollback for.- Parameters:
exceptions
- The exceptions to rollback for
-
getNoRollbackFor
- Returns:
- An unmodifiable set of exceptions to not rollback for.
-
getRollbackFor
- Returns:
- An unmodifiable set of exceptions to rollback for.
-
rollbackOn
- Specified by:
rollbackOn
in interfaceorg.springframework.transaction.interceptor.TransactionAttribute
- Overrides:
rollbackOn
in classorg.springframework.transaction.interceptor.DefaultTransactionAttribute
-