Category "spring-data"

Is it problematic that Spring Data REST exposes entities via REST resources without using DTOs?

In my limited experience, I've been told repeatedly that you should not pass around entities to the front end or via rest, but instead to use a DTO. Doesn't Sp

Hibernate prevent locking of records when updating

I have a long process that run on every user in my database and updates the score and hits fields, while this is running, sometimes a user tries to update his n

Cannot access org.springframework.data from my Java Classes

I'm working on an online tutorial, and in the step where I need to work with databases and add jpa, I cannot access it in my project. I have successfully put t

How apply pagination in reactive Spring Data?

In Spring Data, we have PagingAndSortingRepository which inherits from CrudRepository. In reactive Spring Data, we only have ReactiveSortingRepository which in

Spring. Registering Aspect with @Bean

I need some help with creating Aspect bean. I have module A, B... and module starter-x. I have a couple of Aspects declared in module starter-x, and configura

How to add new Datasource at runtime Spring Boot

I have this, but I don't find any possible solution. All the answers I found was about configuring two or more Datasource or Multitenant Dabatase, but It is not

ORM framework for reactive applications

I have been looking at spring-data-r2dbc for reactive DB access. But it seems it doesn't provide any ORM suppport, as stated on the project's page, it is not an

Creating Pagination in Spring Data JPA

I am trying to implement pagination feature in Spring Data JPA. I am referring this Blog My Controller contains following code : @RequestMapping(value="/orga

Predicate on a field of an entity class which is type of a parent class and filter on fields of its children

In the entity class A there is a field of type P1 named as p. Class P2 and P3 is extended from P1. In the predicate I want to filter the result based on a field

How to tell what action was taken by the JPA save method

I have a repo: public interface SomeRepository extends CrudRepository<SomeClass, Long> { SomeClass findById(Long id); } and I need to save objects

How to limit result in @Query used in Spring Data Repository

I am retrieving data by CrudRepository in Spring Data JPA. I want to filter my records those are retrieved from my custom query provided in @Query annotation. I

Can't Autowire @Repository annotated interface in Spring Boot

I'm developing a spring boot application and I'm running into an issue here. I'm trying to inject a @Repository annotated interface and it doesn't seem to work

How to generate form and crud using Spring and React

I want to dynamically generate crud form based on my API. I am using spring, spring-data-rest and spring-hateoas. I don't wan't to render react from java. I

spring data MongoDB maintaining data integrity in bulk update

I have a scenario where list of say 1000's employees (sample below) where their balance is updated at every month end where balance of each employee can be diff