Category "spring-data-jpa"

detached entity passed to persist - on findByMethod

I understand the error message and i know how to solve it, but i want to know why it occurs in this specific place especially on a find method. I created a mini

Integration Eclipse Collections with Spring Data JPA

is it possible integration eclipse collections with spring data jpa + hibernate? for example: import org.springframework.data.jpa.repository.JpaRepository; im

Spring jpa native query sorting adding prefix to order by field name

I have problem with sorting. Repository method: @Query(nativeQuery = true, value = "SELECT D.ID as dealerId , D.NAME as dealerName, K.ID as kpiId, " + "

How can I get a sequence number from an oracle database with jpaRepository?

I´m trying to get a sequence number from an oracle database using a jpaRepository. The main problem is because I don´t have any Object in JpaReposi

Getting Exception while inserting data in Redshift DB

while fetching data from database It is working fine when trying to insert data in Redshift database getting exception MY POJO class : Quote.java @Entity publi

Using Liquibase to initialize in-memory H2 for unit tests in Spring Boot application

I've used in-mem databases in Spring JPA tests many times, and never had a problem. This time, I have a bit more complex schema to initialize, and that schema m

org.hibernate.LazyInitializationException: failed to lazily initialize a collection of role: FQPropretyName, could not initialize proxy - no Session

I am trying a ManyToOne Bi-Directional Association using SpringBoot, SpringDataJpa along with a unit test using SpringBootTest. However the test fails with the

What difference does it make to put an annotation @Lob or not?

There is a request table in my database. Here is its structure Usually I created the entity with my hands, but this time I decided to generate it from the data

Error with H2 not creating the schema with my data.sql file

I have this project that I just started and using a model from my teacher I created a simple class to be mapped in the H2. So far no problems I run the applicat

How to write subquery in querydsl?

I have used in my project querydsl, hibernate and spring data jpa.I wrote this native query and working fine.but How can I write this query in Querydsl. List&l

Merge query in H2 database giving "Unknown data type:" error

when merge native query is used using JPA, it is resulting into following error: {"ts":"2022-05-05T17:03:12.124+0000","level":"ERROR","message":"SQL Error: 500

spring data jpa on timestamp field for current date?

I have to query on timestamp field for current date and get only 1 record. I can write the query like: @Query("Select i From Log i Where i.createdBy = :userId

How to control the order in which JPA entities are created on Spring Boot App initialization?

How to control the order in which JPA entities are created on Spring Boot App initialization, when we use H2 or MySQL sometimes we feel the child table is creat

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

Kotlin's Arrow Either<Exception, X> and transactions

I am trialing the use of Kotlin's Arrow library Either object to handle exceptions within a project. My experience with it thus far has been OK, but I'm struggl

Consider defining a bean named 'couchbaseRepositoryOperationsMapping' in your configuration. Spring Boot

Any help appreciated ! I have a spring boot application to be connected to couchbase with following details Repository interface @Repository public interf

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

Thymeleaf doesn't print list of objects (Spring JPA)

I have 5 different object of class Tour with some fields.I want that my main page shows this object with their fields. I wrote conrtoller: @Controller

postman post request json payload created and in return , response is empty with respect to spring boot project

**** I have created repository and autowired that to service class and created controller and autowired the service and and the sample code below same code i ha

Difference between save and saveAndFlush in Spring data jpa

I am trying to learn spring data JPA by testing some CRUD operation via JpaRepository. I came across two methods save and saveAndFlush. I don't get the differe