Class JsonbGenerator
- All Implemented Interfaces:
DataGenerator<String>
Generator for JSON / JSONB columns. Produces a JSON object literal (as a
String) with a
configurable number of randomly named fields whose values cycle through the common JSON scalar
types (string, integer, double, boolean). Generation is deterministic for a given seed.
The value is emitted as a String; databases that accept a textual JSON representation
(e.g. PostgreSQL / CockroachDB jsonb) consume it via the default setObject
binding, mirroring the other textual generators (InetGenerator, IntervalGenerator).
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class AbstractDataGenerator
random, randomUtils -
Method Summary
Methods inherited from class AbstractDataGenerator
generateAndSet, generateAsString, reseed, set
-
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
-
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
-