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

The AnnotationRelProvider forces the @Relation annotation to be put in the Entity/DTO class instead of on the Controller #232

Open
jstano opened this issue Aug 22, 2014 · 0 comments

Comments

@jstano
Copy link

jstano commented Aug 22, 2014

The problem here is that in a modular environment the @relation annotation is a "detail" that the domain layer should not know about.

It would seem that it would be cleaner to put the @relation annotation on the same class that the @ExposesResourceFor is on, i.e. the controller.

I modified the AnnotationRelProvider to look first on the controller and only if it isn't found, to then look on the entity.

We could create our own class to do this, but it seems like this change would be useful to other people. It could also be in a new class, possibly ControllerAnnotationRelProvider" if there is concern that the AnnotationRelProvider should not know about controllers.

I've created a pull request for this change.

jstano pushed a commit to jstano/spring-hateoas that referenced this issue Aug 26, 2014
…k on the controller for the @relation annotation in addition to the entity
jstano pushed a commit to jstano/spring-hateoas that referenced this issue Nov 25, 2014
…k on the controller for the @relation annotation in addition to the entity

(cherry picked from commit 0d8484c)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant