Package guru.mikelue.jdut.jdbc
Class JdbcTemplateFactory
- java.lang.Object
-
- guru.mikelue.jdut.jdbc.JdbcTemplateFactory
-
public final class JdbcTemplateFactory extends Object
Template factory for building a bunch a JDBC working, with surrounding ofDbRelease.autoClose(guru.mikelue.jdut.jdbc.JdbcFunction<T, R>)
.
SeeJDBC Function
for usage of this factory.
-
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T extends AutoCloseable>
JdbcRunnablebuildRunnable(JdbcSupplier<? extends T> supplier, JdbcVoidFunction<T> worker)
Builds the runnable and work for JDBC operation.static <T extends AutoCloseable>
JdbcRunnablebuildRunnable(JdbcSupplier<? extends T> supplier, JdbcVoidFunction<T> worker, SurroundingConfig<T,Void> surroundingConfig)
Builds the runnable and work for JDBC operation.static <T extends AutoCloseable,R>
JdbcSupplier<R>buildSupplier(JdbcSupplier<? extends T> supplier, JdbcFunction<T,R> worker)
Builds the supplier and work for JDBC operation.static <T extends AutoCloseable,R>
JdbcSupplier<R>buildSupplier(JdbcSupplier<? extends T> supplier, JdbcFunction<T,R> worker, SurroundingConfig<T,R> surroundingConfig)
Builds the supplier and work for JDBC operation.static <T,R>
JdbcFunction<T,R>surround(JdbcFunction<T,R> surroundedJdbcFunction, JdbcFunction.SurroundOperator<T,R>... surroundings)
Surrounds surroundedJdbcFunction with surroundings(by sequence).static <T,R>
JdbcFunction<T,R>surround(JdbcFunction<T,R> surroundedJdbcFunction, SurroundingConfig<T,R> surroundingConfig)
Surrounds surroundedJdbcFunction with surroundings(by sequence).
-
-
-
Method Detail
-
surround
@SafeVarargs public static <T,R> JdbcFunction<T,R> surround(JdbcFunction<T,R> surroundedJdbcFunction, JdbcFunction.SurroundOperator<T,R>... surroundings)
Surrounds surroundedJdbcFunction with surroundings(by sequence).- Type Parameters:
T
- The type of fed objectR
- The type of returned object- Parameters:
surroundedJdbcFunction
- The function to be surroundedsurroundings
- The surrounding starts with outer block of syntax- Returns:
- The surrounded function
- See Also:
surround(JdbcFunction, SurroundingConfig)
-
surround
public static <T,R> JdbcFunction<T,R> surround(JdbcFunction<T,R> surroundedJdbcFunction, SurroundingConfig<T,R> surroundingConfig)
Surrounds surroundedJdbcFunction with surroundings(by sequence).- Type Parameters:
T
- The type of fed objectR
- The type of returned object- Parameters:
surroundedJdbcFunction
- The function to be surroundedsurroundingConfig
- The lambda expression for configuring surrounding list(starts with outer block of syntax)- Returns:
- The surrounded function
- See Also:
surround(JdbcFunction, JdbcFunction.SurroundOperator...)
-
buildRunnable
public static <T extends AutoCloseable> JdbcRunnable buildRunnable(JdbcSupplier<? extends T> supplier, JdbcVoidFunction<T> worker)
Builds the runnable and work for JDBC operation.- Type Parameters:
T
- The type of fed object- Parameters:
supplier
- The supplier of fed objectworker
- The working code by fed object- Returns:
- The instance of runnable function
-
buildRunnable
public static <T extends AutoCloseable> JdbcRunnable buildRunnable(JdbcSupplier<? extends T> supplier, JdbcVoidFunction<T> worker, SurroundingConfig<T,Void> surroundingConfig)
Builds the runnable and work for JDBC operation.- Type Parameters:
T
- The type of fed object- Parameters:
supplier
- The supplier of fed objectworker
- The working code by fed objectsurroundingConfig
- The lambda expression for configuring surrounding list(starts with outer block of syntax)- Returns:
- The instance of runnable function
-
buildSupplier
public static <T extends AutoCloseable,R> JdbcSupplier<R> buildSupplier(JdbcSupplier<? extends T> supplier, JdbcFunction<T,R> worker)
Builds the supplier and work for JDBC operation.- Type Parameters:
T
- The type of fed objectR
- The type of returned object- Parameters:
supplier
- The supplier of fed objectworker
- The working code input as fed object- Returns:
- The instance of result supplier function
-
buildSupplier
public static <T extends AutoCloseable,R> JdbcSupplier<R> buildSupplier(JdbcSupplier<? extends T> supplier, JdbcFunction<T,R> worker, SurroundingConfig<T,R> surroundingConfig)
Builds the supplier and work for JDBC operation.- Type Parameters:
T
- The type of fed objectR
- The type of returned object- Parameters:
supplier
- The supplier of fed objectworker
- The working code input as fed objectsurroundingConfig
- The lambda expression for configuring surrounding list(starts with outer block of syntax)- Returns:
- The instance of result supplier function
-
-