-
-
Notifications
You must be signed in to change notification settings - Fork 3.7k
HHH-18951 Support custom annotation attributes as configuration parameters of Generator #9442
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
Conversation
|
@gavinking Please review. |
| * @return the Map of annotation attributes, with attribute names as keys and | ||
| * corresponding attribute values as values (never {@code null}) | ||
| */ | ||
| public static Map<String, Object> getAttributes( Annotation annotation ) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Map<String,Object> is what we've just spent years trying to get away from.
|
So I think this patch is in some sense perfectly fine and reasonable, but the thing is that We moved to the new approach in order to achieve type safety, and this change undermines that. So I guess I'm not really very keen on this. |
How about introduce a new functional interface accept the annotation before configure? |
|
Please create PRs primarily against the |
…eters of Generator
OK, should I create another PR or modify this one? I'd like it's fixed in 6.6. |
That's definitely not going to happen. 6.6 is finished and done. But I'm not even convinced we should do this at all. |
|
Alternatively, we could put the annotation self into parameters instead of its attributes. |
That's certainly better. |
|
Well,
Well, I dunno ... maybe not. It's somewhat more typesafe, at least. |
I think if we were going to do this, this would be the way, because the interface would be parameterized by the annotation type, and it would be type safe. But it means adding an additional interface and additional complexity for something that I'm just not convinced we have a great justification for. |
Actually @quaff, I've been forgetting something. We already have an interface like this, and from looking at the code its So I believe the functionality you're asking for already exists (and is even documented), I had just forgotten about it because I'm swapped-out on this stuff. |
My bad, you are right. |
@gavinking The document mentioned |
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license
and can be relicensed under the terms of the LGPL v2.1 license in the future at the maintainers' discretion.
For more information on licensing, please check here.
https://hibernate.atlassian.net/browse/HHH-18951