Does panache generate getters and setter? #29179
-
Hi, We have also tried on the side to just extend a single Entity where we use UUID with PanacheEntityBase and as the rest of our entities kept all the internal variables either package scope or private, with no luck their either We are using Quarkus 2.13.3.Final. Link to the tip https://quarkus.io/guides/hibernate-orm-panache#solution-2-using-the-repository-pattern |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 6 replies
-
/cc @FroMage, @loicmathieu |
Beta Was this translation helpful? Give feedback.
-
Because it's mandatory for JPA. By the way, Hibernate ORM also did this, also via bytecode enhancement.
Yes.
For convenience purpose, if you want to use the repository pattern and still have you getter/setters generated for you. It's a design choice you can made.
If it didn't feel good for you, this design choice may not be OK for you and your team ;). Again, it's a choice you have to make, we just offer the possibility to.
As you said, Lombok may be controversial, I have an opinion on Lombok but I prefere not to start a controverse here ;) |
Beta Was this translation helpful? Give feedback.
-
For us it was the idea of skipping the creation of getters and setters completely, and I got no problem with mixing and maxing just that the code base suddenly implements two patterns where one can break our code structure (a structure where we want to have all our database call code for a given table in one place/layer).
For us it currently brings the need to not write repetitive code and most of our team already uses Lombok plugins since an earlier migration project helps with the Lombok jar. Lombok might not bring any advantages since it hides code implementation behind handy annotations on a class and the team I’m part of has agreed to not use the @DaTa since it was used everywhere on the migration project, that includes entity objects. This kind of agreement could also be used for the mixing of repository and active pattering and might also be enforceable the same way as our @DaTa agreement with a code scanner. |
Beta Was this translation helpful? Give feedback.
/cc @FroMage, @loicmathieu