java.lang.Object
net.foxgenesis.watame.sql.AbstractDatabase
- All Implemented Interfaces:
AutoCloseable
NEED_JAVADOC
- Author:
- Ashley
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionprotected static interfaceprotected static interface -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final org.slf4j.LoggerDatabase loggerprotected DataSourceSQL connection pool -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddCloseHandler(Runnable onClose) NEED_JAVADOCprotected Stringprotected voidcallStatement(String id, AbstractDatabase.StatementConsumer consumer) NEED_JAVADOCprotected voidcallStatement(String id, AbstractDatabase.StatementConsumer consumer, Consumer<SQLException> errorHandler) NEED_JAVADOCvoidclose()protected StringNEED_JAVADOCprotected <R> RmapStatement(String id, AbstractDatabase.StatementFunction<R> function) NEED_JAVADOCprotected <R> RmapStatement(String id, AbstractDatabase.StatementFunction<R> function, Consumer<SQLException> errorHandler) NEED_JAVADOCvoidremoveCloseHandler(Runnable toRemove) NEED_JAVADOCvoidsetup()NEED_JAVADOCtoString()
-
Field Details
-
logger
@Nonnull protected final org.slf4j.Logger loggerDatabase logger -
source
SQL connection pool
-
-
Constructor Details
-
AbstractDatabase
NEED_JAVADOC- Parameters:
properties-
-
-
Method Details
-
setup
NEED_JAVADOC -
getRawStatement
NEED_JAVADOC- Parameters:
id-- Returns:
-
assertRawStatement
- Parameters:
id-- Returns:
-
mapStatement
protected <R> R mapStatement(@Nonnull String id, @Nonnull AbstractDatabase.StatementFunction<R> function) NEED_JAVADOC- Type Parameters:
R-- Parameters:
id-function-- Returns:
-
mapStatement
protected <R> R mapStatement(String id, @Nonnull AbstractDatabase.StatementFunction<R> function, Consumer<SQLException> errorHandler) NEED_JAVADOC- Type Parameters:
R-- Parameters:
id-function-- Returns:
-
callStatement
protected void callStatement(@Nonnull String id, @Nonnull AbstractDatabase.StatementConsumer consumer) NEED_JAVADOC- Parameters:
id-consumer-
-
callStatement
protected void callStatement(@Nonnull String id, @Nonnull AbstractDatabase.StatementConsumer consumer, Consumer<SQLException> errorHandler) NEED_JAVADOC- Parameters:
id-consumer-errorHandler-
-
addCloseHandler
NEED_JAVADOC- Parameters:
onClose-
-
removeCloseHandler
NEED_JAVADOC- Parameters:
toRemove-
-
close
- Specified by:
closein interfaceAutoCloseable- Throws:
Exception
-
toString
-