-
Notifications
You must be signed in to change notification settings - Fork 72
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
Alignment with jakarta.persistence API: @Column can be optional #392
Comments
Thanks, @GeorgHenkel for this contribution! This behavior involves not just only the JNoSQL project but the Jakarta NoSQL specification itself. Maybe it's interesting to address this issue in Jakarta NoSQL specification. What do you think @otaviojava? |
It is a considerable discussion and requires debates like this. As with any topic, we are talking about trade-offs. While the proposal to eliminate the need for the @column annotation in the Eclipse JNoSQL framework may seem appealing in simplifying the codebase and convention over configuration, it poses several significant drawbacks that outweigh its potential benefits.
Based on trade-offs, we can define it. One thing we can do is allow the vendor to make this column Optional or not. |
I completely get your points and mostly agree with you that explicit annotations are a better way of documentation and clarity for developers unfamiliar with the codebase. I would definitively go with the current solution of explicit annotations. But I wanted to mentioned it, because with a JPA background I was used to drop the annotations where it is not needed :)
When I understand you correct, the vendor can decide, if |
And this point is super important; thank you for raising it.
It works with explicit annotations, but we can decide to be optional such as JPA or delegates it to the vendors. |
Which JNoSQL project the issue refers to?
JNoSQL (Core)
Use case
Coming from an JPA / relational background it was a little counterintuitive that the
@Column
is mandatory for every field that should be included in the document. Especially for complex relations, that are annotated with@Entity
or@Embeddable
.Feature proposal
Make
@Column
optional and mark fields that should be not persisted in the resulting document with@Transient
and/or respect the transient keyword.The text was updated successfully, but these errors were encountered: