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
1
vote
1 answer

Error initialising Repository bean in Spring Data JDBC. Auto configuration not working for Spring data Jdbc

I am creating custom data sources and when I am trying to create a repository, the bean is not getting initialized properly and I am getting an error as…
1
vote
1 answer

spring-boot-starter-jdbc DAO repository object not injected in working legacy webservice

I am new in the spring/boot word and have a working JAX-WS based web-service declared in a springboot project. It is started and configured via web.xml and sun-jaxws.xml. So, no beans included there only endpoints declarations and servlet…
1
vote
1 answer

Spring data JDBC is not creating tables

I am trying to persist an entity called Instructor to H2 in-memory database using Spring data JDBC, if I create the tables manually everything works fine, otherwise I get this error (I added the entire error stack trace at the…
Hasan Aga
  • 718
  • 8
  • 27
1
vote
0 answers

JaVers configuration for spring data JDBC

I am trying to use JaVers with Spring Boot project with Spring Data JDBC included. So, default JaversSqlAutoConfiguration.java do not fit which is for jpa hibernate. Could you please help to identify JaVers configuration for Spring Boot project with…
1
vote
2 answers

Is it possible to return custom Java objects combining multiple aggregates in Spring Data JDBC?

I have multiple aggregate classes, such as Request, Scribe, Candidate, and Exam. Sample schema: Request (id, scribe_id, candidate_id, exam_id, status) Scribe (id, name) Candidate (id, name) Exam (id, name, schedule) As you can see, Request table has…
Omkar Shetkar
  • 3,488
  • 5
  • 35
  • 50
1
vote
1 answer

Why is a entity - value relationship implemented as a back reference in Spring Data JDBC

In Spring Data JDBC if an entity (e.g. Customer) has a value (e.g. Address) like in the example here the value has a back reference column (column customer in table address) to the entity in the db schema: CREATE TABLE "customer" ( "id" …
1
vote
1 answer

Is there any possible way to map the name of foreign key in reference table? (ManyToMany)

I tried to implement a reference table when it comes to ManyToMany relation in the context of DDD based on this article(https://spring.io/blog/2018/09/24/spring-data-jdbc-references-and-aggregates) I have different naming for JdbcEntity because I…
Jay Ahn
  • 73
  • 5
1
vote
1 answer

Convert JSON string in DB column to Map in @ReadingConverter

How do I convert JSON String stored in a DB column to a Map attribute defined in entity class Product? I have defined a @ReadingConverter JsonToMapConverter class and a ProductRepository. Calling productRepository.findAll() throws error…
user2176499
  • 363
  • 3
  • 16
1
vote
1 answer

Oracle dialect for pagination

We are retrieving data from oracle using spring data JDBC We are using org.springframework.data.relational.core.dialect.OracleDialect to retrieve data from database. It is working as expected when we have a repository that uses CrudRepository But if…
1
vote
2 answers

Unable to save aggregate root with UUID id in sqlite

In my project I have the following entity which can be successfully saved in Postgres: public class Aggregate { @Id private UUID id; private JsonNode data; // getters and setters omitted } When I try to save the same entity in SQLite I…
tamm0r
  • 179
  • 1
  • 2
  • 12
1
vote
0 answers

Spring Data JDBC: Can I create my UUID PKs on the client side, and not on the server?

Client side PK creation is pretty common, especially when using UUIDs as keys. Unfortunately I can't see where this is supported in Spring Data JDBC. I get these errors instead: Failed to execute…
Bean Taxi
  • 1,104
  • 1
  • 9
  • 22
1
vote
0 answers

springboot with spring-data-jdbc and postgres: Trailing junk on timestamp

After an upgrade of spring boot 2.2.11 to 2.3.9, some database queries in our application stopped working. When I downgraded to 2.3.8, they did work again. So something must have changed from 2.3.8 to 2.3.9, but I still haven't found out what it…
dendron
  • 63
  • 1
  • 5
1
vote
1 answer

Saving entities with user defined primary key values

I'm quite new to the Spring Data JDBC library, but so far I'm really impressed. Unfortunately JDBC driver for my database (SAP Hana) doesn't support retrieving of generated keys after INSERT (implementation of method…
1
vote
1 answer

Not able to save entity using spring data jdbc in postgres

I am trying to save data in postgres using spring data jdbc. i am able to update, get and delete entity but i am not able to save it. took a sample project from internet and I tried to follow spring data example for jdbc, used JdbcAggregateTemplate…
Sonal Gupta
  • 31
  • 1
  • 5
1
vote
1 answer

Is this a correct solution to the Spring Data JDBC problem of the insert/update?

PROBLEM: when I tried to create a new entity 'Customer' with Spring Data JDBC (in a Spring-boot application) @Data public class Customer { @Id private String identifier; private String name; } Using a…