Package org.jdbi.v3.core.statement
Class BaseStatement<This>
- java.lang.Object
-
- org.jdbi.v3.core.statement.BaseStatement<This>
-
- All Implemented Interfaces:
java.io.Closeable,java.lang.AutoCloseable,Configurable<This>
- Direct Known Subclasses:
Batch,MetaData,SqlStatement
abstract class BaseStatement<This> extends java.lang.Object implements java.io.Closeable, Configurable<This>
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interfaceBaseStatement.StatementCustomizerInvocation
-
Constructor Summary
Constructors Constructor Description BaseStatement(Handle handle)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description (package private) voidaddCustomizers(java.util.Collection<StatementCustomizer> customizers)ThisattachToHandleForCleanup()Registers with the handle for cleaning when the handle is closed.private static voidattachToHandleForCleanup(Handle handle, StatementContext context)(package private) voidcallCustomizers(BaseStatement.StatementCustomizerInvocation invocation)protected voidcleanUpForException(java.sql.SQLException e)voidclose()booleanequals(java.lang.Object o)ConfigRegistrygetConfig()Returns the configuration registry associated with this object.StatementContextgetContext()Returns the statement context associated with this statement.private java.util.Collection<StatementCustomizer>getCustomizers()HandlegetHandle()inthashCode()-
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.jdbi.v3.core.config.Configurable
addCustomizer, configure, define, getConfig, registerArgument, registerArgument, registerArrayType, registerArrayType, registerArrayType, registerArrayType, registerCodecFactory, registerCollector, registerCollector, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerColumnMapper, registerExtension, registerRowMapper, registerRowMapper, registerRowMapper, registerRowMapper, setMapKeyColumn, setMapValueColumn, setSqlArrayArgumentStrategy, setSqlLogger, setSqlParser, setTemplateEngine, setTimingCollector
-
-
-
-
Field Detail
-
typedThis
final This typedThis
-
handle
private final Handle handle
-
ctx
private final StatementContext ctx
-
-
Constructor Detail
-
BaseStatement
BaseStatement(Handle handle)
-
-
Method Detail
-
getHandle
public final Handle getHandle()
-
getConfig
public ConfigRegistry getConfig()
Description copied from interface:ConfigurableReturns the configuration registry associated with this object.- Specified by:
getConfigin interfaceConfigurable<This>- Returns:
- the configuration registry associated with this object.
-
getContext
public final StatementContext getContext()
Returns the statement context associated with this statement.- Returns:
- the statement context associated with this statement.
-
attachToHandleForCleanup
@Alpha public final This attachToHandleForCleanup()
Registers with the handle for cleaning when the handle is closed.
There are some situations where Statements need to be cleaned up to avoid resource leaks. This method registers the current Statement it with the Handle. If the statement or the context are cleaned by themselves, it will automatically unregister, so in normal operations, resources should not pool for cleanup with the Handle.- Since:
- 3.35.0
-
attachToHandleForCleanup
private static void attachToHandleForCleanup(Handle handle, StatementContext context)
-
cleanUpForException
protected final void cleanUpForException(java.sql.SQLException e)
-
addCustomizers
void addCustomizers(java.util.Collection<StatementCustomizer> customizers)
-
callCustomizers
final void callCustomizers(BaseStatement.StatementCustomizerInvocation invocation)
-
getCustomizers
private java.util.Collection<StatementCustomizer> getCustomizers()
-
close
public void close()
- Specified by:
closein interfacejava.lang.AutoCloseable- Specified by:
closein interfacejava.io.Closeable
-
equals
public final boolean equals(java.lang.Object o)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
public final int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
-