Package com.pyranid

Class StatementLog.Builder

java.lang.Object
com.pyranid.StatementLog.Builder
Enclosing class:
StatementLog

public static class StatementLog.Builder extends Object
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 Details

    • connectionAcquisitionTime

      public StatementLog.Builder connectionAcquisitionTime(Optional<Long> connectionAcquisitionTime)
      Specifies how long it took to acquire a Connection from the DataSource, in nanoseconds.
      Parameters:
      connectionAcquisitionTime - how long it took to acquire a Connection, if available
      Returns:
      this Builder, for chaining
    • preparationTime

      Specifies how long it took to bind data to a PreparedStatement, in nanoseconds.
      Parameters:
      preparationTime - how long it took to bind data to a PreparedStatement, 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

      public StatementLog.Builder resultSetMappingTime(Optional<Long> resultSetMappingTime)
      Specifies how long it took to extract data from a ResultSet, in nanoseconds.
      Parameters:
      resultSetMappingTime - how long it took to extract data from a ResultSet, 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 empty List 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

      public StatementLog build()
      Constructs a StatementLog instance.
      Returns:
      a StatementLog instance