jklingsporn / vertx-jooq

A jOOQ-CodeGenerator to create vertx-ified DAOs and POJOs.
MIT License
385 stars 53 forks source link

Can I use some methods of `lombok` when generate pojos? #175

Open leavestylecode opened 3 years ago

leavestylecode commented 3 years ago

I hope generated pojos can support @With @Builder(toBuilder = true).

Create an immutable object & edit pojos can be more functional.

jklingsporn commented 3 years ago

Can you give an example what you are trying to achieve? How would the final POJO look like? Currently, there is no lombok-support planned.

leavestylecode commented 3 years ago

Sometimes we obtain model from db, we want to change some params value of this. From the characteristics of functional programming, we hope that objects have immutability and no side effects. So I often use @With @builder(toBuilder = true) of Lombok.

When I change a value of model. Such as change name, I will.... var newModel = model.withName(newName); When I change multi values of model. Such as change name、address、profession, I will.... var newModel = model.toBuilder.name(newName).address(newAddress).profession(newProfession).build();

return a new model. I don't worry about data conflicts or data being overwritten.