-
Notifications
You must be signed in to change notification settings - Fork 230
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
enable to put aanotation on private field #691
Comments
Why do you want to annotate a private field? Sent with GitHawk |
This is similar to issue #644. It is not possible today - but a high priority item. I suspect we'll fix in the next month or so. |
First pass - we'll probably end up following JPA 1.0 conventions where the We could also search for the This means Elide will only look at fields or only look at properties for any given entity (all determined by where the Thoughts on this? @wcekan @tbo-axelor @clayreimann @DennisMcWherter |
That sounds like a reasonable way to do this to me. It will force some consistency on how your models are annotated which may make them easier to read rather than supporting a mixed case. That said, is there much extra work to support a mixed approach? The defaulting behavior could be with I like your original suggestion (I personally think it's better style to use one or the other), but you could imagine a situation where the model has been annotated with field-level annotations and then there comes a need for a single getter-based annotation. In this case, the user would have to reannotate the model with getters for this to work rather than just adding an Just something to consider. If it's not significantly more work, it may be nicer to consider how code may evolve. |
If we support a mix of properties and fields - we'll need to disambiguate conflicts (where the same attribute is both a property and field). That feels like a refactor of the EntityBinding to me. I'm not opposed to it being done if someone feels compelled. However, the critical part of this to me seems like the need to support field level access (as this is a very common pattern). My guess is that mixed properties and fields is not a common case. |
I am certainly not against enabling wholesale one or the other as a first pass. Maybe we proceed with this solution (since it should be fairly straightforward) and can prioritize the work for mixed tasks if we find other users needing it. |
thank u @aklish and @DennisMcWherter fix in 4.2.7 right. |
@tbo-axelor It should work. I should probably add some tests for this. |
For entities which annotate the primary key getter (JPA property) with `@Id`, the behavior should be identical to 4.2.6 and earlier. For entities which annotate the primary key field (JPA field) with `@Id`, Elide will only expose fields and computed attributes/relationships (which can be properties). Fixes #691 and Fixes #644 and Fixes #443
my entity class is
it is working fine.
but i want annotation put on private field so it is possible ??
The text was updated successfully, but these errors were encountered: