business icon indicating copy to clipboard operation
business copied to clipboard

Automatically resolve identity field using persistence-specific annotations

Open adrienlauer opened this issue 4 years ago • 0 comments

Currently, it is necessary to mark the identity field of an entity with @Identity for the business framework to recognize the field as the identity (thus avoiding the need to override getId() which is always possible).

This leads to an annotation overload on the identity field. Also developers tend to not understand why it is necessary to put the @Identity annotation in addition to the already required persistence annotation.

We could create an IdentityResolver interface in the business framework that could be implemented in the various persistence add-ons to allow to understand persistence annotations directly. This should work in a static context (without injection) because identity fields are detected statically one-time per class.

adrienlauer avatar Mar 23 '21 14:03 adrienlauer