Spring Data REST (SDR) is a Spring Data project that aims to make it easy to expose Spring Data repositories as REST services. SDR use Spring HATEOAS internally to create HAL response.
Questions tagged [spring-data-rest]
2228 questions
11
votes
3 answers
Spring data REST: Update a resource´s association using proper HTTP method
I am using Spring Data REST, and I am trying to change a many-to-one relation using Spring REST, but I cannot get the proper http call to work.
My entity looks like this (basic calls like creation with POST etc. works fine):
{
"id" : 70,
…

Daniel
- 744
- 8
- 24
11
votes
3 answers
spring-data-rest, can you provide full details of entity instead of (or with) link
Is there a way to return the full details of a joined entity instead of a link? In the example below I want to also return the details of the product, if I have list of 100 purchases, it would avoid having to make 100 calls to get the product…

wenic
- 1,169
- 2
- 14
- 23
10
votes
1 answer
Spring HATEOAS build link to paged resource
I have a controller with method, which returns PagedResource, which looks like this:
@RequestMapping(value = "search/within", method = RequestMethod.POST)
public @ResponseBody PagedResources within(@RequestBody GeoJsonBody body,
…

Виталик Бушаев
- 801
- 10
- 26
10
votes
1 answer
Spring Data Rest PUT v.s PATCH LinkableResources
I'm using Spring Data REST to expose my Entity's and their relationships. I have a OneToOne relationship between two Entity's and I'm trying to update/change the relationship with PUT and PATCH.
I noticed that Spring Data REST will only allow you…

szxnyc
- 2,495
- 5
- 35
- 46
10
votes
1 answer
Does Spring Data REST support reactive crud repositories?
I've got really simple and standard OrderRepository:
@RepositoryRestResource(collectionResourceRel="orders", path="orders")
public interface OrderRepository extends ReactiveCrudRepository {
}
After hitting the server with:
curl…

Daniel
- 109
- 1
- 7
10
votes
1 answer
Spring Data Rest adding excerpt projection switches off lazy fetching
I'm new to Spring Data Rest and trying to play around with its basic concepts. Everything works well so far, but few days ago I noticed that the application performance suddenly dropped after putting the projections into business.
These are my…

Petar
- 103
- 1
- 3
10
votes
2 answers
restdocs SnippetException due to HAL "_links" elements from spring-data-rest
My app is using spring-data-rest and spring-restdocs.
My setup is really standard; copied from the docs almost entirely, but I've included the samples below in case I'm missing something.
When my mvc test runs, it fails…

Eric J Turley
- 350
- 1
- 5
- 20
10
votes
2 answers
Spring Data Rest: removing _links attributes from the response of a hypermedia Rest JPA entities
I want to customize the response of a hypermedia Rest JPA entity and want to remove all the _links attributes and self link attributes.
My client application is not that big and it knows what exact REST API's to call. So I feel these extra bytes…

Dhruv
- 10,291
- 18
- 77
- 126
10
votes
1 answer
Spring Data Mongodb findBy In case insensitive
I'm trying to create a Spring Data MongoDB repository method that could perform case insensitive search for fields from a given list, that is functionality similar to SQL 'IN' operator.
In my repository I have following methods:
User…

Sergey Shcherbakov
- 4,534
- 4
- 40
- 65
10
votes
2 answers
Spring Data Rest Custom Controller
I have requirement where in which i need to override the delete functionality from the rest Resource using a custom controller.here is the code for restResource
@RepositoryRestResource
public interface SampleRepository extends…

Raghu Chaitanya
- 151
- 2
- 8
10
votes
4 answers
How can I simply add a link to a Spring Data REST Entity
I have my Entities with Spring Data JPA, but to generate stats about them, I use jOOQ in a Spring @Repository.
Since my methods return either a List of entities, or a Double, how can I expose them as links? Let's say I have a User entity, I want to…

Desiderantes
- 169
- 1
- 1
- 13
10
votes
2 answers
Spring Data Rest Custom Method return String
I need a custom Method on Spring Data Rest that has some kind of input and returns a String.
@BasePathAwareController
@RequestMapping(value = "/businessActions")
public class BusinessActionController implements…

Peter Müller
- 273
- 2
- 8
10
votes
1 answer
Filling entity links in custom @RepositoryRestController methods
I am using Spring-data-rest to provide read APIs over some JPA entities.
For writes I need to issue Command objects rather than directly write to the DB, so I added a custom controller using @RepositoryRestController and various command handling…

Andrea Ratto
- 815
- 1
- 11
- 23
10
votes
1 answer
Add links into projection's nested object
I use Spring Data REST's projections feature in order to have some nested-typed objects inside JSON:
{
"id": 1,
"name": "TEST",
"user": {
"id": 1,
"name": "user1"
},
_links: {
self: {
href:…

nKognito
- 6,297
- 17
- 77
- 138
10
votes
1 answer
ALPS metadata for all Spring-MVC Controller
I've a question about the ALPS support in spring hateoas/data rest. It seems that the ALPS metadata are only exposed if you have a spring data rest repository. So my question is why is there only a support for the spring data rest repository and can…

meleagros
- 482
- 1
- 5
- 17