Jooq Random Records

jooq-random-record is a library that generates random Java beans, simmilar to the existing one random-beans but built especially for jooq records!

License

License

Categories

Categories

jOOQ Data Databases
GroupId

GroupId

com.jpomykala
ArtifactId

ArtifactId

jooq-random-record
Last Version

Last Version

0.0.1
Release Date

Release Date

Type

Type

jar
Description

Description

Jooq Random Records
jooq-random-record is a library that generates random Java beans, simmilar to the existing one random-beans but built especially for jooq records!

Download jooq-random-record

How to add to project

<!-- https://jarcasting.com/artifacts/com.jpomykala/jooq-random-record/ -->
<dependency>
    <groupId>com.jpomykala</groupId>
    <artifactId>jooq-random-record</artifactId>
    <version>0.0.1</version>
</dependency>
// https://jarcasting.com/artifacts/com.jpomykala/jooq-random-record/
implementation 'com.jpomykala:jooq-random-record:0.0.1'
// https://jarcasting.com/artifacts/com.jpomykala/jooq-random-record/
implementation ("com.jpomykala:jooq-random-record:0.0.1")
'com.jpomykala:jooq-random-record:jar:0.0.1'
<dependency org="com.jpomykala" name="jooq-random-record" rev="0.0.1">
  <artifact name="jooq-random-record" type="jar" />
</dependency>
@Grapes(
@Grab(group='com.jpomykala', module='jooq-random-record', version='0.0.1')
)
libraryDependencies += "com.jpomykala" % "jooq-random-record" % "0.0.1"
[com.jpomykala/jooq-random-record "0.0.1"]

Dependencies

compile (3)

Group / Artifact Type Version
org.jooq : jooq jar 3.10.5
org.projectlombok : lombok jar 1.18.6
org.reflections : reflections jar 0.9.9

test (2)

Group / Artifact Type Version
org.junit.jupiter : junit-jupiter-api jar 5.3.2
org.assertj : assertj-core jar 3.12.0

Project Modules

There are no modules declared in this project.

jOOQ random record

What is jooq-random-record?

jooq-random-record is a library that generates random Java beans, simmilar to the existing one random-beans but built especially for jooq records! Let's say you have a class CompanyRecord generated by jooq and you want to generate a random instance of it, here we go:

CompanyRecord randomize = RandomJooq.randomize(CompanyRecord.class);

assertThat(randomize.getId()).isNotNull();
assertThat(randomize.getName()).isNotNull();
assertThat(randomize.getExipreOn()).isNotNull();
assertThat(randomize.getDemo()).isNotNull();
assertThat(randomize.getTaxId()).isNotNull();
assertThat(randomize.getLegalName()).isNotNull();
assertThat(randomize.getCreated()).isNotNull();

Let's see another example. If you want to generate a random stream of 10 CompanyRecords, you can use the following snippet:

List<CompanyRecord> output = RandomJooq.randomizeList(10, CompanyRecord.class);

Installation

<dependency>
  <groupId>com.jpomykala</groupId>
  <artifactId>jooq-random-record</artifactId>
  <version>0.0.1</version>
</dependency>

Contribution

Would you like to add something or improve source? Create new issue, let's discuss it

  • If in doubt, please discuss your ideas first before providing a pull request. This often helps avoid a lot of unnecessary work. In particular, we might prefer not to prioritise a particular feature for another while.
  • Fork the repository.
  • The commit message should reference the issue number.
  • Check out and work on your own fork.
  • Try to make your commits as atomic as possible. Related changes to three files should be committed in one commit.
  • Try not to modify anything unrelated.

More

License

The MIT License

Versions

Version
0.0.1