Questions tagged [spring-data-rest]

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.

2228 questions
1
vote
1 answer

Spring Data REST findAll with multiple Ids

Sorry if this sounds trivial. What is the URL for calling the following Spring DATA REST Repository method: findAll(Iterable ids); I tried: http://localhost:5000/book?ids=5450f92352d1d609c0c75291,5450f92352d1d609c0c75292 …
Klaus
  • 2,328
  • 5
  • 41
  • 62
1
vote
1 answer

spring rest data plural url

I have a domain class called StoreType.java which is exposed by below spring repository public interface StoreTypeRepository extends PagingAndSortingRepository { } When I access this using url…
Vijay Kumar Rajput
  • 1,071
  • 1
  • 10
  • 30
1
vote
1 answer

Spring beans GeoModule bean injection to RepositoryRestMvcConfiguration

I'm currently testing spring data rest, and I want to expose the primary keys (ids) of my entities through the REST interface. I have found that the proper (?) way to do this is: public class IdExporterConfiguration extends…
SzaboAdam
  • 314
  • 3
  • 15
1
vote
1 answer

Pagination in Spring Data Rest for nested resources

When the below URL is visited, I get paginations in response /api/userPosts/ { "_links" : { "self" : { "href" : "/api/userPosts{?page,size,sort}", "templated" : true }, "next" : { "href" :…
fortm
  • 4,066
  • 5
  • 49
  • 79
1
vote
1 answer

Configuring Jackson to enable self-referencing objects using jackson-datatype-hibernate

How do I configure the Jackson ObjectMapper in Spring Data when using Spring Boot? When I try returning a self-referencing entity I keep getting a "com.fasterxml.jackson.databind.JsonMappingException: No serializer found for class…
Kent Bull
  • 1,144
  • 3
  • 21
  • 41
1
vote
2 answers

Implementing/Overriding MongoRepository Keep HATEOAS Formatting

I have a simple MongoRepository I would like to modify to return the generated ObjectId on post(save()). public interface EmployeeRepository extends MongoRepository { public void delete(Employee employee); public…
Nestor Ledon
  • 1,925
  • 2
  • 23
  • 36
1
vote
0 answers

Using Spring Data REST without defined type

I want to store data to the database using Spring Data REST. The rational is that the DB may change from customer to customer and we would not need to change aspects of the solution that are not stricly related to DB operations. In fact, the…
1
vote
1 answer

How to add additional links to the root resource in Spring Data REST?

The spring-data-rest module automatically scans for all repositories in an app and lists them like this: { "_links" : { "demoRepository" : { "href" : "http://localhost/demoRepository{?page,size,sort}", "templated" : true } } However…
1
vote
1 answer

spring-data-rest HAL base urls in api management platform

So i have a spring-data-rest app hosted in heroku: hotel-app.herokuapp.com but i want to expose it in an api management platform like mashape. curl --get --include "https://greekscholar-test-v1.p.mashape.com/" \ -H "X-Mashape-Key:…
1
vote
2 answers

Id must be assignable to Serializable With LAZY @ManyToOne

When I have entities having following - @ManyToOne(fetch = FetchType.LAZY) @JoinColumn(name = "question", nullable = false, referencedColumnName="id") I get below error. The error goes away however after making only @ManyToOne associations as…
fortm
  • 4,066
  • 5
  • 49
  • 79
1
vote
0 answers

Change Spring Data Rest default message for DataIntegrityViolationException

I have a basic JPA Entity that I would like to expose via Spring-Data-Rest @Entity @Table(name='test') class Test{ @Id Long id @Column(name='other_id', unique = true) String otherId @Column(name='other_crm_id') String…
Beanz
  • 208
  • 3
  • 12
1
vote
2 answers

How to globally customize the collection resource rel and path for Spring Data REST resources?

Basing on https://spring.io/guides/gs/accessing-data-rest/ in the sample project https://github.com/jcoig/gs-accessing-data-rest) i have repository defined as follows: @RepositoryRestResource public interface PersonRepository extends…
jcoig
  • 303
  • 1
  • 4
  • 8
1
vote
1 answer

How can I add my tasks back to my list using Restangular

So here's the flow that I'd like request wise, intial page load -> get tasks -> add task. add task, should not require a subsequent fetch of it's created task or the list. here's the relevant part of my app.js thus far .config(function…
xenoterracide
  • 16,274
  • 24
  • 118
  • 243
1
vote
1 answer

Spring Security Rest

I'm having a set of Sping Data Repositories which are all exposed over Rest by using Spring-data-rest project. Now I want to secure the HTTP, so that only registered users can access the http://localhost:8080/rest/ So for this purpose I add…
Petar Tahchiev
  • 4,336
  • 4
  • 35
  • 48
1
vote
2 answers

What are the advantages of using Spring Data REST over Spring Data JPA?

I know that spring data rest will export your repositories as REST services..but i want to know advantages of that over use of spring data jpa.
MasterCode
  • 975
  • 5
  • 21
  • 44