0

я объявил pagingandSortingRepository для лица JPA и ответ на FindAll() нижеPagingandsortingrepositrory весной данных, первичный ключ в сущности нет в ответе

"_embedded" : { 
    "assetDashboardCustomers" : [ { 
     "utilization" : "80", 
     "_links" : { 
     "self" : { 
      "href" : "http://localhost:8080/utilbycustomer/Customer01" 
     }, 
     "assetDashboardCustomer" : { 
      "href" : "http://localhost:8080/utilbycustomer/Customer01" 
     } 
     } 
    }, 

Я не хочу _links и сам [HATEOAS] подробности, но просто простой JSON. Что такое свойство следует установить таким образом, чтобы получить простое JSON в ответ

+1

http://stackoverflow.com/questions/23264044/disable-hypertext-application-language-hal-in-json –

+0

Если вы хотите включить идентификатор ID для ресурса, вы можете включить его в org.springframework.data.rest.core.config.RepositoryRestConfiguration –

+0

Я следил за шаги в вопросе, но изменяется только тип содержимого в заголовке, а не фактическое содержимое JSON – tamilnad

ответ

0

The first comment answers your first question - you cannot turn off the links. The second comment answers you 2nd question which is how to have the ID in the JSON body.

--- Алан сеном в комментариях