Package com.pyranid
Class StatementLog.Builder
java.lang.Object
com.pyranid.StatementLog.Builder
- Enclosing class:
StatementLog
Builder for
StatementLog
instances.
Created via StatementLog.forSql(String)
, for example
StatementLog.Builder builder = StatementLog.forSql("SELECT * FROM car WHERE id=?").parameters(singletonList(123)); StatementLog statementLog = builder.build();
- Since:
- 1.0.0
- Author:
- Mark Allen
-
Method Summary
Modifier and TypeMethodDescriptionSpecifies the size of the batch operation.build()
Constructs aStatementLog
instance.connectionAcquisitionTime
(Optional<Long> connectionAcquisitionTime) Specifies how long it took to acquire aConnection
from theDataSource
, in nanoseconds.Specifies the exception that occurred during SQL statement execution.executionTime
(Optional<Long> executionTime) Specifies how long it took to execute a SQL statement, in nanoseconds.parameters
(List<Object> parameters) The parameters bound to the SQL statement that was executed.preparationTime
(Optional<Long> preparationTime) Specifies how long it took to bind data to aPreparedStatement
, in nanoseconds.resultSetMappingTime
(Optional<Long> resultSetMappingTime) Specifies how long it took to extract data from aResultSet
, in nanoseconds.statementMetadata
(Optional<StatementMetadata> statementMetadata) Specifies metadata associated with this SQL statement.
-
Method Details
-
connectionAcquisitionTime
Specifies how long it took to acquire aConnection
from theDataSource
, in nanoseconds.- Parameters:
connectionAcquisitionTime
- how long it took to acquire aConnection
, if available- Returns:
- this
Builder
, for chaining
-
preparationTime
Specifies how long it took to bind data to aPreparedStatement
, in nanoseconds.- Parameters:
preparationTime
- how long it took to bind data to aPreparedStatement
, if available- Returns:
- this
Builder
, for chaining
-
executionTime
Specifies how long it took to execute a SQL statement, in nanoseconds.- Parameters:
executionTime
- how long it took to execute a SQL statement, if available- Returns:
- this
Builder
, for chaining
-
resultSetMappingTime
Specifies how long it took to extract data from aResultSet
, in nanoseconds.- Parameters:
resultSetMappingTime
- how long it took to extract data from aResultSet
, if available- Returns:
- this
Builder
, for chaining
-
parameters
The parameters bound to the SQL statement that was executed.- Parameters:
parameters
- the parameters bound to the SQL statement that was executed, or an emptyList
if none- Returns:
- this
Builder
, for chaining
-
batchSize
Specifies the size of the batch operation.- Parameters:
batchSize
- how many records were processed as part of the batch operation, if available- Returns:
- this
Builder
, for chaining
-
exception
Specifies the exception that occurred during SQL statement execution.- Parameters:
exception
- the exception that occurred during SQL statement execution, if available- Returns:
- this
Builder
, for chaining
-
statementMetadata
Specifies metadata associated with this SQL statement.- Parameters:
statementMetadata
- the metadata associated with this SQL statement, if available- Returns:
- this
Builder
, for chaining
-
build
Constructs aStatementLog
instance.- Returns:
- a
StatementLog
instance
-