Class LongGenerator

All Implemented Interfaces:
DataGenerator<Long>

public class LongGenerator extends AbstractDataGenerator<Long>
Generates long values drawn uniformly from the half-open range [startInclusive, endExclusive) using the seeded random source, so a given seed yields a reproducible sequence. The default range is [0, Long.MAX_VALUE). The 64-bit analogue of IntegerGenerator.
  • Method Details

    • generate

      public Long generate()
      Description copied from interface: DataGenerator
      Generates a random value of type T.
      Returns:
      a generated value, may be null if the generator supports nullable columns
    • set

      public void set(Connection connection, PreparedStatement statement, int parameterIndex, Long value) throws SQLException
      Description copied from interface: DataGenerator
      Sets a specific value on a PreparedStatement parameter.
      Specified by:
      set in interface DataGenerator<Long>
      Overrides:
      set in class AbstractDataGenerator<Long>
      Parameters:
      connection - the database connection
      statement - the prepared statement to set the parameter on
      parameterIndex - the 1-based parameter index
      value - the value to set
      Throws:
      SQLException - if the database operation fails
    • get

      public Long get(ResultSet resultSet, int columnIndex) throws SQLException
      Description copied from interface: DataGenerator
      Retrieves a value from a ResultSet column.
      Parameters:
      resultSet - the result set to read from
      columnIndex - the 1-based column index
      Returns:
      the value from the result set, properly cast to type T
      Throws:
      SQLException - if the database operation fails