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

Spring Data JDBC custom query parameter converter

I am trying to add a custom query to a Spring Data JDBC CrudRepository to allow finding entities by an alternate natural key. The entity has an ID which is in this case a Long, and a natural key, that is of type Reference (underlying type is…
1
vote
2 answers

Spring Data JDBC SQLFeatureNotSupportedException while saving list of enum to MySql

I've a model named Role. A role has a list of Permissions, simple as that. Using org.springframework.boot:2.2.5.RELEASE, spring-jdbc version 5.2.24, mysql-connector-java-8.0.19, mysql server version 5.7.28 You can also checkout…
hevi
  • 2,432
  • 1
  • 32
  • 51
1
vote
1 answer

Incorrect mapping between Father and Child tables

I'm trying to model a Father/Children relationship in Spring Data JDBC (version 1.1.5.RELEASE). So far i've managed to get the insert operation working, but i'm struck with an error when reading the data. Entities look like…
Piwakkio
  • 63
  • 1
  • 3
  • 12
1
vote
1 answer

Spring Data JDBC: Required identifier property not found for a MappedCollection

class Game( @MappedCollection(idColumn = "game") <---- unnecessary var rules: List = emptyList(), ){ @Id var id: Long? = null } data class Rule( @MappedCollection(idColumn = "rule", keyColumn = "rule_key")<----…
hevi
  • 2,432
  • 1
  • 32
  • 51
1
vote
1 answer

Spring-fu-Kofu: Unable to wire `NamedParameterJdbcTemplate`

I am playing around with Kofu functional Bean DSL. I am using Spring-Data-JDBC with Spring-MVC and trying to autowire NamedParameterJdbcTemplate. However, I am have been receiving this error that no beans found for it while running tests. In a…
Gopal S Akshintala
  • 1,933
  • 1
  • 17
  • 24
1
vote
1 answer

Does Spring-Data-JDBC support Oracle identity columns?

I'm trying to save into a table with an Oracle identity field (it's some sort of auto increment). But as soon as I do that I get an "identity must not be null after save" exception ? Is this scenario currently not supported or do I need a special…
rogergl
  • 3,501
  • 2
  • 30
  • 49
1
vote
1 answer

Spring Data JDBC - Clob column to String property in POJO not working

I have an Oracle database with a table that has a DESCRIPTION column of type CLOB. My POJO looks like this: import java.util.Date; import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import…
Datum Geek
  • 1,358
  • 18
  • 23
1
vote
0 answers

Spring DATA JDBC fails to inject a Repository when run from the spring integration test

Spring Boot JDBC with Spring Boot: 2.2.4.RELEASE, in gradle the dep: implementation ("org.springframework.boot:spring-boot-starter-data-jdbc") The dep to -data-jpa (see "duplicated question") //implementation…
ses
  • 13,174
  • 31
  • 123
  • 226
1
vote
1 answer

What state does the entity need to trigger the [update] operation?

Version: 1.1.2.RELEASE I have the following simple test code JobTask task1 = new JobTask(null, "task1", "sync files", JobStatus.RUNNING); JobTask savedTask = jobTaskReponsitory.save(task1); savedTask.setTaskDesc("update descript."); …
Hyman Yang
  • 33
  • 6
1
vote
1 answer

Is StatementBuilder for external use?

I was implementing a project with spring-data-jdbc and I found the Statement Builder API. I could this API be used for building native sql repositories?
dhb
  • 11
  • 1
  • 2
1
vote
1 answer

Spring Data Jdbc: Name must not be empty error on nested one to many relationship implementation

I'm using Spring Boot 2.2.0.RELEASE and spring-data-jdbc 1.1.0.RELEASE Tried to implement nested one to many relationship using spring-data-jdbc. One book has many chapters and each chapter has many parts. public class Book { private…
David
  • 312
  • 3
  • 10
1
vote
1 answer

Problems to inject Repository when data-jpa dep is on

I noticed, as soon as I un-comment JPA dep, see below: implementation("org.springframework.boot:spring-boot-starter-jdbc") implementation ("org.springframework.boot:spring-boot-starter-data-jdbc") //implementation…
ses
  • 13,174
  • 31
  • 123
  • 226
1
vote
2 answers

spring-data-jdbc readOnly

I'm trying to make some field readOnly -> insert and update aka save() should not send that field to DB but the field should be populated with select. @ReadOnlyProperty from org.springframework.data.annotation.ReadOnlyProperty does not do the…
1
vote
1 answer

How to set database schema of an aggregate/entity in spring data jdbc

I am new to spring-data-jdbc and just trying to port a small project, which currently uses JPA, for evaluation purposes. My existing entities use a database schema which can easily be defined by JPAs @Table annotation on the entity level. I saw,…
Tobi
  • 2,001
  • 2
  • 27
  • 49
1
vote
1 answer

Spring-data-jdbc - How to set schema in many-to-many relationship

I am following the spring.io blog here: https://spring.io/blog/2018/09/24/spring-data-jdbc-references-and-aggregates and have a sample SpringBoot app with Book and Author entities here: https://github.com/b-sridhar/spring-data-jdbc-example. I get…
Sri
  • 48
  • 4