Giorgio Spilorcio
unread,May 27, 2025, 2:49:14 PMMay 27Sign in to reply to author
Sign in to forward
You do not have permission to delete messages in this group
Either email addresses are anonymous for this group or you need the view member email addresses permission to view the original message
to Project Lombok
I wanted to ask for an opinion about this idea that I would find useful:
I have some simple data classes annotated with @Setter or @Data, i have a list of these data classes that can change value as the program does its job, however at the end these must be saved.
If you use a database you need to make a query to replace the updated values, however some of this data classes might have not changed at all, so you introduce an `updated` field that is defaults to false and becomes true if any setter has been triggered. And we replace the record in the database only if `updated` is true.
This is a simple case with @Setter(trackUpdate = true), however if we need to be fully correct we might need a @TrackUpdate field that updates said `updated` field whenever we set a field in a method that isn't a constructor.