Class SqlBlobGenerator
- All Implemented Interfaces:
DataGenerator<Blob>
Generator for SQL
BLOB (binary large object) columns.
Generation is not yet implemented: generate() and generateAsString()
currently return null, so nullable BLOB columns fill with null and a
non-nullable one will fail at insert. set(Connection, PreparedStatement, int, Blob)
and get(ResultSet, int) bind and read a Blob normally, so round-tripping an
existing value works.
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class AbstractDataGenerator
random, randomUtils -
Method Summary
Modifier and TypeMethodDescriptiongenerate()Generates a random value of type T.Generates a value and returns its string representation.Retrieves a value from a ResultSet column.voidset(Connection connection, PreparedStatement statement, int parameterIndex, Blob value) Sets a specific value on a PreparedStatement parameter.Methods inherited from class AbstractDataGenerator
generateAndSet, reseed
-
Method Details
-
generate
Description copied from interface:DataGeneratorGenerates a random value of type T.- Returns:
- a generated value, may be null if the generator supports nullable columns
-
generateAsString
Description copied from interface:DataGeneratorGenerates a value and returns its string representation.- Specified by:
generateAsStringin interfaceDataGenerator<Blob>- Overrides:
generateAsStringin classAbstractDataGenerator<Blob>- Returns:
- the string representation of a generated value
-
set
public void set(Connection connection, PreparedStatement statement, int parameterIndex, Blob value) throws SQLException Description copied from interface:DataGeneratorSets a specific value on a PreparedStatement parameter.- Specified by:
setin interfaceDataGenerator<Blob>- Overrides:
setin classAbstractDataGenerator<Blob>- Parameters:
connection- the database connectionstatement- the prepared statement to set the parameter onparameterIndex- the 1-based parameter indexvalue- the value to set- Throws:
SQLException- if the database operation fails
-
get
Description copied from interface:DataGeneratorRetrieves a value from a ResultSet column.- Parameters:
resultSet- the result set to read fromcolumnIndex- the 1-based column index- Returns:
- the value from the result set, properly cast to type T
- Throws:
SQLException- if the database operation fails
-