Open cptully opened 2 years ago
Sorry for very late reply.
Main goal for this project was to generate MapStruct presence checkers for partial update REST requests.
With such requests null
values must not be treated as absent values. Absent values doesn't cause update, but null
values in DTO causes Entity field to be set to null
.
Another issue is that not every type has isEmpty()
method.
Actually this project is mainly for academical purpose, I had an interest in hacking Lombok. So feel free to use it as ground for your own Lombok plugin.
I forked your project, intending to make this change myself for something at work but I cannot seem to pull all of the dependencies when behind my corporate firewall... I will have to try on my personal computer this weekend.
We use HAPI FHIR and they have a more robust implementation of hasXxxx() that you may find interesting:
public boolean hasXxxx() { return this.xxxx != null && !this.xxxx.isEmpty(); }