Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Automatically resolve identity field using persistence-specific annotations #113

Open
adrienlauer opened this issue Mar 23, 2021 · 0 comments

Comments

@adrienlauer
Copy link
Member

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant