-
Notifications
You must be signed in to change notification settings - Fork 165
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
Improve support for @PostLoad
annotation
#516
Labels
Comments
michael-simons
referenced
this issue
Sep 3, 2018
Forcing the PostLoad method to be public and non final leads to poor domain classes: - often the postload method is also used from the constructor, so they should be at least final so that the class can be safely overwritten - also postload should usually not be an exposed method to calling code, it’s used to be only internal Steps taken: - Include „final“ methods in MethodsInfo. That should be the least problematic, didn’t find any usage of proxies - When postload is executed, check if the annotated method is accessible. MethodInfo already includes protected, package private and private methods, we can at least try to use them
michael-simons
added a commit
that referenced
this issue
Sep 3, 2018
…Construct. Forcing the PostLoad method to be public and non final leads to poor domain classes: - often the postload method is also used from the constructor, so they should be at least final so that the class can be safely overwritten - also postload should usually not be an exposed method to calling code, it’s used to be only internal Steps taken: - Include „final“ methods in MethodsInfo. - When postload is executed, check if the annotated method is accessible. If not, try to make it accessible.
michael-simons
added a commit
that referenced
this issue
Sep 3, 2018
This changes the way `@PostLoad` methods are computed: - Don’t store MethodInfo by their name but by their method, as the name is not even unique per class - Traverse class hierarchy for method infos and prioritize lower class methods - Make sure that no ambigious scenerio can be created with multiple `@PostLoad` methods.
michael-simons
added a commit
that referenced
this issue
Sep 3, 2018
…Construct. Forcing the PostLoad method to be public and non final leads to poor domain classes: - often the postload method is also used from the constructor, so they should be at least final so that the class can be safely overwritten - also postload should usually not be an exposed method to calling code, it’s used to be only internal Steps taken: - Include „final“ methods in MethodsInfo. - When postload is executed, check if the annotated method is accessible. If not, try to make it accessible.
michael-simons
added a commit
that referenced
this issue
Sep 3, 2018
This changes the way `@PostLoad` methods are computed: - Don’t store MethodInfo by their name but by their method, as the name is not even unique per class - Traverse class hierarchy for method infos and prioritize lower class methods - Make sure that no ambigious scenerio can be created with multiple `@PostLoad` methods.
michael-simons
added a commit
that referenced
this issue
Sep 4, 2018
…Construct. Forcing the PostLoad method to be public and non final leads to poor domain classes: - often the postload method is also used from the constructor, so they should be at least final so that the class can be safely overwritten - also postload should usually not be an exposed method to calling code, it’s used to be only internal Steps taken: - Include „final“ methods in MethodsInfo. - When postload is executed, check if the annotated method is accessible. If not, try to make it accessible.
michael-simons
added a commit
that referenced
this issue
Sep 4, 2018
This changes the way `@PostLoad` methods are computed: - Don’t store MethodInfo by their name but by their method, as the name is not even unique per class - Traverse class hierarchy for method infos and prioritize lower class methods - Make sure that no ambigious scenerio can be created with multiple `@PostLoad` methods.
meistermeier
pushed a commit
that referenced
this issue
Sep 4, 2018
This changes the way `@PostLoad` methods are computed: - Don’t store MethodInfo by their name but by their method, as the name is not even unique per class - Traverse class hierarchy for method infos and prioritize lower class methods - Make sure that no ambigious scenerio can be created with multiple `@PostLoad` methods.
meistermeier
pushed a commit
that referenced
this issue
Sep 4, 2018
…Construct. Forcing the PostLoad method to be public and non final leads to poor domain classes: - often the postload method is also used from the constructor, so they should be at least final so that the class can be safely overwritten - also postload should usually not be an exposed method to calling code, it’s used to be only internal Steps taken: - Include „final“ methods in MethodsInfo. - When postload is executed, check if the annotated method is accessible. If not, try to make it accessible.
meistermeier
pushed a commit
that referenced
this issue
Sep 4, 2018
This changes the way `@PostLoad` methods are computed: - Don’t store MethodInfo by their name but by their method, as the name is not even unique per class - Traverse class hierarchy for method infos and prioritize lower class methods - Make sure that no ambigious scenerio can be created with multiple `@PostLoad` methods.
Closed with 51ba9fb. |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
@PostLoad
is not executed in a class hierarchy, see#414 (comment).
There is PR #485 that solves this issue.
Furthermore,
@PostLoad
should behavior similar JSR 250's @PostConstruct:With the addition that we don't create proxies and can allow final methods.
Thus gives us better means to structure domain classes, that is: the post load methods are not exposed and are constrained to a given context and not part of a public API.
The text was updated successfully, but these errors were encountered: