Spring Data Rest
I understand that Spring Data REST allows one to export JPA based repositories as restful endpoints.However, in my case, i have a mapping between the domain entity class (annotated with @Entity) and the REST representation class (the mapping is taken care of by Dozer). The user can access the resource via the REST representation alone which will internally be mapped to the actual resource. Question: Can i convert the representation class as a restful endpoint using spring data REST without making changes to the domain layer? Or is it only at the level of a Repository interface that extends CRUDRepository/MongoDB that can be exported?
If I understood right, you'd like Spring to expose a REST service automatically from your repository as shown in the following example http://spring.io/guides/gs/accessing-mongodb-data-rest/
But returning your representation beans mapped by Dozer rather than the ones from the persistance layer.
I'm afraid that if you want that, you'll need to write your own controllers and let them call your repository methods.
Please take a look at this post already answered:
Spring HATEOAS versus Spring Data Rest
链接地址: http://www.djcxy.com/p/89592.html下一篇: 春季数据休息