Questions tagged [spring-data-jdbc]

Spring Data JDBC is part of the Spring Data umbrella project which makes it easy to implement JDBC based repositories.

Spring Data JDBC Project page.

Github Repository.

Introduction into Spring Data JDBC or if you prefer video over text try this 10 minute video introduction.

The very important topic of Aggregates and its ramifications for Spring Data JDBC.

FAQ

324 questions
0
votes
1 answer

Spring Data JDBC and Hibernate JPA in One Project

Is it possible to have Spring Data JDBC and Spring Data hibernate in one project ? @SpringBootApplication @ComponentScan(basePackages = {"com.meteor", "com.test"}) //@EnableMeteorTransactionManagement @EnableFeignClients(basePackages =…
grassbl8d
  • 2,089
  • 4
  • 24
  • 34
0
votes
1 answer

Understanding errors with JPMS modules

I am having a rough time deciphering what these errors mean, let alone even begin to resolve them. I am trying to use java platform modules (using jdk 14) with a simple "gradle-based, multi-module" project (everything works perfectly fine with jdk…
0
votes
2 answers

Spring data jdbc error BadSqlGrammarException: PreparedStatementCallback; bad SQL grammar

I've below domain model objects, with below DDL and spring version, when i try to fetch the complete aggregate (just two entities) with my custom sql, spring-data returns below error. when I remove the aggregate definition( i.e, remove the…
Rajesh
  • 83
  • 11
0
votes
1 answer

Challenge Persisting Complex Entity using Spring Data JDBC

Considering the complexities involved in JPA we are planning to use Spring Data JDBC for our entities for its simplicity. Below is the sample structure and we have up to 6 child entities. We are able to successfully insert the data into various of…
dinesh
  • 13
  • 5
0
votes
2 answers

How can i cache the data in Spring api rest

i am doing a back app using spring boot, i had created an api rest formed by controllers, services and repositories. To the ddbb conection i am using spiring data jdbc. in some cases i have querys which need pagination, for example the query has 100…
0
votes
1 answer

Rollback in multiples querys using JDBC spring

i have this problem, when i execute two querys in same function, if the second query throw exception and not working, the first query keep yor result in database, both querys are insert in ddbb EXAMPLE: public void myFunction(){ query1(); //insert…
0
votes
1 answer

Spring Data CrudRepository.findAllById exception with large number of IDs

I am using the Spring Data JDBC (version 1.1.6) method CrudRepository.findAllById to load entities from a database with a large number of IDs. The underlying database connection uses a Postgres database. The invocation of the method raises a…
sakra
  • 62,199
  • 16
  • 168
  • 151
0
votes
1 answer

How to consume a jar that has spring as a packaged dependency in another spring project with higher spring version?

There are numerous questions on 'How to' add one spring project as a dependency into another spring project. But what I am looking for is solving a specific problem once we have successfully answered the 'How to' part. Say we have two spring based…
djpanda
  • 835
  • 10
  • 20
0
votes
1 answer

Spring data JDBC, can I get a return value as an entity in a custom insert query?

@Repository public interface RoomRepository extends CrudRepository { @Override List findAll(); @Modifying @Query("INSERT INTO room VALUES(:id, :name)") RoomEntity insert(@Param("id") String uuid,…
0
votes
1 answer

Is Spring Data Jdbc recommended for Oracle 18c?

Is Spring Data JDBC v1.1.5 recommended for Oracle Database and Enterprise Applications? Lot of samples around the net based on Open Source RDBMS (H2 or PostgreSQL). We are using Spring Data JDBC in a Spring Boot Microservice Application, facing…
bmk1977
  • 141
  • 3
  • 10
0
votes
1 answer

Why Spring Data doesn't support returning entity for modifying queries?

When implementing a system which creates tasks that need to be resolved by some workers, my idea would be to create a table which would have some task definition along with a status, e.g. for document review we'd have something like reviewId,…
0
votes
1 answer

Questions in the official Spring documentation

Here is an example from the official documentation (You need to scroll down a little): class Person { private final @Id Long id; private final String firstname, lastname; …
Hyman Yang
  • 33
  • 6
0
votes
1 answer

spring-data-jdbc: query entity containing 1-n relation with JOOQ

I am trying to load entities containing a reference to another entity (1-n) with the help of JOOQ (based on spring-data-jdbc). I'm started extending the spring-data-jdbc-jooq-example. The adjusted model with the 1-n relation: @Data public class…
einsA
  • 797
  • 1
  • 7
  • 19
0
votes
1 answer

Spring Data JDBC not generating derived Query

I am using Spring Data JDBC (v1.1.1) automatically pulled in by SpringBoot 2.2.1.RELEASE. For the repository below, the method should automatically derive the Query at start-up time. interface AccountRepository extends CrudRepository
0
votes
1 answer

Does ORM in Spring Data JDBC support JOINs when mapping entities?

I'm implementing one-to-many relationship using Spring Data JDBC (1.0.10.RELEASE), where i.e. one Customer can have many Orders. When executing JOIN query I can see in DEBUG that after performing JOIN query, there are executed additional queries for…
Rafal
  • 1
  • 1
1 2 3
21
22