0

I'm using Spring Boot to build a REST service. And this works perfectly.

I create a @Controller, a @Service and a @Repository (JpaRepository) layer and a @Entity domain class. So I have for example

  • OrganisationController
  • OrganisationService
  • OrganisationRepository and
  • Organisation (domain pojo)

With a few injections and configs I have my REST API GET /organisation/1 running. Nice!

But now, after using this strategy extensively I have the feeling this can be done more efficient. And probably Spring (Boot) has thought about this already.

I have worked with a good solution: HATEOAS (and HAL). However, I don't really like the complex hateoas json. I would like simple responses (without all the links, embeds and more). What is the best approach to accomplish this?

HATEOAS is pretty much what I need (just simple CRUD operations). I only need more control over the output.

btw: I prefer Java Config and annotations over XML.

Neil Stockton
  • 11,383
  • 3
  • 34
  • 29
codesmith
  • 1,381
  • 3
  • 20
  • 42
  • 1
    Have you looked at http://projects.spring.io/spring-data-rest/ ? – reto Apr 07 '16 at 07:58
  • @reto I just have. Seems like hateoas to me. I get the same response (having links, embeds and all). – codesmith Apr 07 '16 at 08:25
  • 1
    I guess this answers my question about leaving out the Hateoas elements: http://stackoverflow.com/questions/24421538/spring-data-rest-without-hateoas – codesmith Apr 07 '16 at 09:50

0 Answers0