io.quarkiverse.doma.runtime.UnsupportedTransactionManager Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-doma Show documentation
Show all versions of quarkus-doma Show documentation
Simplify your database accesses with compile-time code generation
The newest version!
package io.quarkiverse.doma.runtime;
import java.util.function.Supplier;
import jakarta.inject.Singleton;
import org.seasar.doma.jdbc.tx.TransactionIsolationLevel;
import org.seasar.doma.jdbc.tx.TransactionManager;
import io.quarkus.arc.DefaultBean;
@Singleton
@DefaultBean
public class UnsupportedTransactionManager implements TransactionManager {
@Override
public void required(Runnable block) {
throw useNarayanaJta();
}
@Override
public void required(TransactionIsolationLevel isolationLevel, Runnable block) {
throw useNarayanaJta();
}
@Override
public RESULT required(Supplier supplier) {
throw useNarayanaJta();
}
@Override
public RESULT required(
TransactionIsolationLevel isolationLevel, Supplier supplier) {
throw useNarayanaJta();
}
@Override
public void requiresNew(Runnable block) {
throw useNarayanaJta();
}
@Override
public void requiresNew(TransactionIsolationLevel isolationLevel, Runnable block) {
throw useNarayanaJta();
}
@Override
public RESULT requiresNew(Supplier supplier) {
throw useNarayanaJta();
}
@Override
public RESULT requiresNew(
TransactionIsolationLevel isolationLevel, Supplier supplier) {
throw useNarayanaJta();
}
@Override
public void notSupported(Runnable block) {
throw useNarayanaJta();
}
@Override
public void notSupported(TransactionIsolationLevel isolationLevel, Runnable block) {
throw useNarayanaJta();
}
@Override
public RESULT notSupported(Supplier supplier) {
throw useNarayanaJta();
}
@Override
public RESULT notSupported(
TransactionIsolationLevel isolationLevel, Supplier supplier) {
throw useNarayanaJta();
}
@Override
public void setRollbackOnly() {
throw useNarayanaJta();
}
@Override
public boolean isRollbackOnly() {
throw useNarayanaJta();
}
@Override
public void setSavepoint(String savepointName) {
throw new UnsupportedOperationException();
}
@Override
public boolean hasSavepoint(String savepointName) {
throw new UnsupportedOperationException();
}
@Override
public void releaseSavepoint(String savepointName) {
throw new UnsupportedOperationException();
}
@Override
public void rollback(String savepointName) {
throw new UnsupportedOperationException();
}
private UnsupportedOperationException useNarayanaJta() {
return new UnsupportedOperationException(
"Use quarkus-narayana-jta directly. See https://quarkus.io/guides/transaction");
}
}