Skip to content

Supports POJO classes with public fields without accessors (getter/setter)  #1372

@Nick-Wunderdog

Description

@Nick-Wunderdog

Is your feature request related to a problem? Please describe.
Spring supports POJO classes without accessors (getter/setter) with just public fields, aka. anamic classes. While anemic classes are contraversial issue, Spring and all relates other libraries do support them so for this to be compatible and follow Spring convention, so should this library support them.

Describe the solution you'd like
Support Entity class annotated public fields without accessor methods. Like Spring Data (REST) does.

Describe alternatives you've considered
Document clearly that anemic classes are not supported with this library.

Additional context
Anemic classes are contraversial but there is school of though that they are ok in Entity classes as those should NOT contain any business logic. So them being anamic and immutable would be ideal. Unfortunately it is difficult or even impossible to make them immutable (to make fields public final) so all of the solutions are helf measures. And since there is no clear universal convention on this, it would be nice to support commonly accepted best practices. Even if their schools of though are at war each others. Some - like myself - think that anemic entity classes are smaller antipatterns than contaminating whole project with Lombok.

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions