Package guru.mikelue.jdut.jdbc.function
Class Transactional<T extends Connection,R>
- java.lang.Object
-
- guru.mikelue.jdut.jdbc.function.Transactional<T,R>
-
- Type Parameters:
T
- The type of connection objectR
- The type of returned value
- All Implemented Interfaces:
JdbcFunction.SurroundOperator<T,R>
public final class Transactional<T extends Connection,R> extends Object implements JdbcFunction.SurroundOperator<T,R>
As surrounding of JDBC function for transactional wrapping.
For example:
// function_1 - An instance of JdbcFunction function_1 = function_1.surroundedBy(Transactional::simple); // function_2 - An instance of JdbcFunction function_2 = function_2.surroundedBy(new Transaction(Connection.TRANSACTION_READ_COMMITTED));
-
-
Constructor Summary
Constructors Constructor Description Transactional(int newTransactionIsolation)
Constructs with setting of transaction isolation.Transactional(Optional<Integer> newTransactionIsolation)
Constructs with setting of transaction isolation.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static <T extends Connection,R>
JdbcFunction<T,R>simple(JdbcFunction<T,R> jdbcFunction)
BuildsJdbcFunction.SurroundOperator
with simple configuration of transaction.JdbcFunction<T,R>
surround(JdbcFunction<T,R> jdbcFunction)
Surrounds function.-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface guru.mikelue.jdut.jdbc.JdbcFunction.SurroundOperator
asUnaryOperator
-
-
-
-
Method Detail
-
simple
public static <T extends Connection,R> JdbcFunction<T,R> simple(JdbcFunction<T,R> jdbcFunction)
BuildsJdbcFunction.SurroundOperator
with simple configuration of transaction.- Type Parameters:
T
- The type of connection objectR
- The type of returned value- Parameters:
jdbcFunction
- The function to be surrounded- Returns:
- The transactional function
-
surround
public JdbcFunction<T,R> surround(JdbcFunction<T,R> jdbcFunction)
Surrounds function.- Specified by:
surround
in interfaceJdbcFunction.SurroundOperator<T extends Connection,R>
- Parameters:
jdbcFunction
- The function to be surrounded- Returns:
- The final function
-
-