org.grails.transaction.GrailsTransactionAttribute Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of grails-core Show documentation
Show all versions of grails-core Show documentation
Grails Web Application Framework
package org.grails.transaction;
import java.util.List;
import org.springframework.transaction.TransactionDefinition;
import org.springframework.transaction.interceptor.RollbackRuleAttribute;
import org.springframework.transaction.interceptor.RuleBasedTransactionAttribute;
import org.springframework.transaction.interceptor.TransactionAttribute;
public class GrailsTransactionAttribute extends RuleBasedTransactionAttribute {
private static final long serialVersionUID = 1L;
private boolean inheritRollbackOnly = true;
public GrailsTransactionAttribute() {
super();
}
public GrailsTransactionAttribute(int propagationBehavior, List rollbackRules) {
super(propagationBehavior, rollbackRules);
}
public GrailsTransactionAttribute(TransactionAttribute other) {
super();
setPropagationBehavior(other.getPropagationBehavior());
setIsolationLevel(other.getIsolationLevel());
setTimeout(other.getTimeout());
setReadOnly(other.isReadOnly());
setName(other.getName());
}
public GrailsTransactionAttribute(TransactionDefinition other) {
super();
setPropagationBehavior(other.getPropagationBehavior());
setIsolationLevel(other.getIsolationLevel());
setTimeout(other.getTimeout());
setReadOnly(other.isReadOnly());
setName(other.getName());
}
public GrailsTransactionAttribute(GrailsTransactionAttribute other) {
this((RuleBasedTransactionAttribute)other);
}
public GrailsTransactionAttribute(RuleBasedTransactionAttribute other) {
super(other);
if(other instanceof GrailsTransactionAttribute) {
this.inheritRollbackOnly = ((GrailsTransactionAttribute)other).inheritRollbackOnly;
}
}
public boolean isInheritRollbackOnly() {
return inheritRollbackOnly;
}
public void setInheritRollbackOnly(boolean inheritRollbackOnly) {
this.inheritRollbackOnly = inheritRollbackOnly;
}
}