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
1
vote
1 answer
Directly consuming Spring-Data-Rest repositories on Client side?
I created Model objects and exposed in REST style using Spring-Data-Rest,is it possible for me to directly use it by respective end-points on client side(Front end)?
Or i need to create Spring MVC Controller which again going to fetch data from DAO…

Asokan
- 99
- 1
- 4
1
vote
1 answer
Spring Data / REST - Javascript (jquery, backbone) restful calls end up with a 404 response
I've got an example app: https://github.com/LateralThoughts/orsyp-frontend-training/tree/master/zupr_trackr.
It exposes 3 JPA entities (Company, Employee, Activity) via REST resources handled by Spring DATA/REST.
Although I can successfully query…

fbiville
- 8,407
- 7
- 51
- 79
1
vote
1 answer
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…

user2235365
- 11
- 2
1
vote
2 answers
Reference to log4j.xml broken after maven dependency spring-data-rest-webmvc, packages abbreviated
I have a problem with my (java) Spring 3 project:
I've included a maven dependency to "spring-data-rest-webmvc" (version 1 through 1.0.0-RC3) where the standard log4j.xml is not used anymore. Instead it appears some other properties logging file is…

Danielson
- 2,605
- 2
- 28
- 51
1
vote
1 answer
spring data rest: why is all content exposed in general object uri (e.g. /files/), not only in specific uri (e.g. /files/1)
I am setting up a project using spring data rest.
Exposing my domain model seems to work, but I have some strange behaviour:
According to the wiki/docs if I access a uri like /files/
I should end up with an array of links to the single files. But, I…

Hühnerbrust
- 63
- 4
0
votes
1 answer
How do I use JavaScript Traverson HAL $all meta selector?
Per the JavaScript Traverson HAL documentation
For embedded arrays you can additionally use the meta selector $all,
which operates on embedded documents: If you pass ht:post[$all] to the
follow method, you receive the complete array of posts, not…

James
- 2,876
- 18
- 72
- 116
0
votes
0 answers
Cannot use UUID in APIs generated by Spring Data Rest
I have below entity configuration
@Entity
@RestResource
public class Employee {
@Id
@GeneratedValue
@Type(type = "pg-uuid")
private UUID id;
@OneToMany(mappedBy = "employee")
@RestResource(path = "projects", rel =…

user09
- 920
- 2
- 12
- 38
0
votes
0 answers
Is there a Spring Data REST equivalent for GraphQL schemas?
Is there an equivalent to Spring Data REST for GraphQL?
More specifically a library that automatically generates GraphQL schemas and query-, schema- and batch-mappings based on a noSQL schema in the database.
Similar to…
0
votes
0 answers
Compare changed fields in @PreAuthorize function
I'm writing a spring application which uses spring-data-rest to expose a restish API for CRUD operations on my entities.
I'm using role based permissions and most of my entity repositories have either a @PreAuthorize("hasAnyRole('ADMIN') or…

Simon Lenz
- 2,732
- 5
- 33
- 39
0
votes
0 answers
Spring Data REST: force openapi schema export
When working with SDR, I need that the associated resources are expanded in the returned JSON. I have achieved this by adding @RestResource(exported = false) to the associated resource. For example:
@NotNull
@RestResource(exported =…

FkJ
- 1,609
- 1
- 19
- 29
0
votes
1 answer
Which repository for sorting on a nested entity property using Spring Data JPA?
I want to get sorted list of Models for a given set of Car vins. The following repository query attempts to do this:
@Query("select distinct c.model"
+ "from Car c "
+ "where c.id in :vins")
public Set…

James
- 2,876
- 18
- 72
- 116
0
votes
0 answers
Choosing Between Spring Data REST Endpoint and JpaRepo
As a newcomer to Spring Boot, I have encountered the Spring Data REST framework, which offers convenient endpoints for CRUD operations. In my specific scenario, I need to execute custom business logic before saving a user. To achieve this, I have…
0
votes
1 answer
Can I use a @RequestParam as a @Query parameter when using Spring Data Rest?
I'm using Spring Data Rest, my Repository extends JpaRepository and I want to create a custom query with @Query.
My method parameter is a @RequestParameter and I want to use it as a parameter for the query:
@Query("SELECT u FROM User u WHERE u.name…

m_jdm35
- 25
- 1
- 5
0
votes
1 answer
RepositoryRestController: POST with multiple HAL URI
I've OneToMany relation between User & Address and ManyToOne relation with EmploymentType.
@Entity
public class User {
//..
private String name;
@ManyToOne
private EmploymentType employmentType;
@OneToMany(mappedBy = "user")
…

Kiran Kyle
- 99
- 11
0
votes
0 answers
how to use spring data rest with multiple boot apps
I have two aggregate roots, Account which holds id, name and Alert which holds id, title and Account(@ManyToOne). Using spring boot with data-jpa and data-rest I can see the full magic in swagger-ui.
Now I want to achieve the same result while…

tomer.kalich
- 1
- 2