Skip to content

jpomykala/jooq-random-record

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

14 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

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

About

๐Ÿ›  jOOQ Random records generation

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages