I'm looking for a way to generate a class from database values, in order to provide an updated builder class using the latest values available. The use case is this:
With a table that looks like this
| id | ref_type |
|---|---|
| 1 | name |
| 2 | status |
| 3 | address |
I am hoping to generate a builder class that can be used like this
new ClassBuilder()
.setName(name)
.setStatus(status)
.setAddress(address)
.build();
The goal is to be able to generate an updated builder class whenever values are added to the database table (using Liquibase). Is anyone aware of any libraries that can help with this, or a strategy for doing this from scratch? Our projects are mostly Java 11, with Groovy and Spring Boot.