Skip to content
Advertisement

Tag: spring-data-rest

How to search in parent entity scope when using spring boot data rest

Now I know how to findBySomething on root level entity. Let’s say I have a one to many relation of class -> student I can now students/search/findByName?name=Tom But it will give me Tom in all classes. Can I do something like classes/1/students/search/findByName?name=Tom It gives error right now. Answer in StudentController in StudentService in StudentRepository (I use mongoDB; if u use

Column ‘foreign_key_id’ cannot be null

I have a rest api exposed via @RepositoryRestResource from spring-data-rest-api. When I try to give the json payload from Postman to create a User linked to an Organization, it complains that Column ‘organizationId’ cannot be null, when I clearly provided it in the json. Each user belongs to an organization, so it’s a many to one relationship. I want Java

“org.springframework.data.util.TypeInformation.getActualType()” because “propertyType” is null

A Spring Boot 2.5.1 application is logging this warning: whereas Spring Boot 2.4.4 does not. The POJO is trivial: and the Spring RestController is similarly: To trigger the warning submit a POST: The warning is triggered while “handling” the _links property of the EntityModel<SoPojo> but why and what can I do about it. Any ideas? Update: As dkb notes, this

Spring Data Rest – Soft Delete

I’ve been using spring data rest without any problem but now I have a requirement that when a user performs a DELETE operation on a given entity i.e. DELETE /accounts/<id> I need to set a flag on the database marking that entity as deleted but i do want to keep the record. Basically this means that I need to do

Advertisement