spring-data-jdbc

Spring Data JDBC Firebird dialect not recognized

爷,独闯天下 提交于 2020-07-06 19:27:06
问题 I'm trying to connect to Firebird database using Spring Data JDBC and Spring Boot. I've created a simple app using Spring Tools. Spring Data JDBC doesn't recognize the dialect. I believe the problem is that the DialectResolver doesn't support Firebird. private static Dialect getDialect(Connection connection) throws SQLException { DatabaseMetaData metaData = connection.getMetaData(); String name = metaData.getDatabaseProductName().toLowerCase(Locale.ENGLISH); if (name.contains("hsql")) {

Composite Key and spring-data-jdbc

核能气质少年 提交于 2020-06-23 07:28:31
问题 I have a database which is using composite keys. Is it possible to utilize spring-data-jdbc? I tried the milestone version 1.1M2 where I mapped my entity in the following way: class History { @ID @Embedded private CompositeHistoryID id; } Then in my repository class, I added HistoryRepository extends Repository<History,CompositeHistoryID >{ History findByhId(CompositeHistoryID id) } I traced the SQL, and it did not work. The embedded part worked, but the where clause was not correct. It was

New Error in spring boot 2.3.0.RELEASE : UnsatisfiedDependencyException for Oracle 12.2.0.1 jdbcdriver but not with mysql jdbcdriver

≯℡__Kan透↙ 提交于 2020-06-17 07:25:06
问题 Created a fresh boot project with just jdbc and Oracle jdbc as dependencies <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jdbc</artifactId> </dependency> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc8</artifactId> <version>12.2.0.1</version> </dependency> I configure the datasource in the application.properties file and run this simple application and it bombs with below stacktrace. 2020-05-25 15:07:16.769 WARN 11840 --- [ main] s

New Error in spring boot 2.3.0.RELEASE : UnsatisfiedDependencyException for Oracle 12.2.0.1 jdbcdriver but not with mysql jdbcdriver

北城余情 提交于 2020-06-17 07:23:46
问题 Created a fresh boot project with just jdbc and Oracle jdbc as dependencies <dependency> <groupId>org.springframework.boot</groupId> <artifactId>spring-boot-starter-data-jdbc</artifactId> </dependency> <dependency> <groupId>com.oracle</groupId> <artifactId>ojdbc8</artifactId> <version>12.2.0.1</version> </dependency> I configure the datasource in the application.properties file and run this simple application and it bombs with below stacktrace. 2020-05-25 15:07:16.769 WARN 11840 --- [ main] s

Mapping Java Enum in Postgresql with Spring Data JDBC

旧时模样 提交于 2020-06-17 02:14:26
问题 I want to be able to map a enum declared in java to an enum created in postgres. For example having the following: CREATE TYPE EYE_COLOR AS ENUM ('BROWN', 'BLUE', 'GREEN'); CREATE TABLE PERSON ( ID INT PRIMARY KEY AUTO_INCREMENT, NAME NVARCHAR2(128) NOT NULL, EYE EYE_COLOR ); In java I have something like this: public enum EyeColor { BROWN, BLUE, GREEN } public class Person { @Id Long id; String name; EyeColor eye; } When I try to do save something to the database like this: personRepository

Mapping Java Enum in Postgresql with Spring Data JDBC

╄→尐↘猪︶ㄣ 提交于 2020-06-17 02:14:24
问题 I want to be able to map a enum declared in java to an enum created in postgres. For example having the following: CREATE TYPE EYE_COLOR AS ENUM ('BROWN', 'BLUE', 'GREEN'); CREATE TABLE PERSON ( ID INT PRIMARY KEY AUTO_INCREMENT, NAME NVARCHAR2(128) NOT NULL, EYE EYE_COLOR ); In java I have something like this: public enum EyeColor { BROWN, BLUE, GREEN } public class Person { @Id Long id; String name; EyeColor eye; } When I try to do save something to the database like this: personRepository

Spring Data JDBC Generating Bad HSQLDB Query with Boot 2.3.0

安稳与你 提交于 2020-06-08 20:01:07
问题 I have a Spring Boot project that uses Spring Data JDBC. The tests use HSQLDB. My repository tests started failing when I attempted an upgrade to Spring Boot 2.3.0. Spring Data JDBC appears to now quote table and column names. The version of Spring Data JDBC included with Spring Boot 2.2.7 did not. The project at https://github.com/mrgrew/boot230bug demonstrates the difference. Spring Boot 2.3.0 generates INSERT INTO "stats.counter" ("COUNTER_NAME") VALUES (?) which fails. Spring Boot 2.2.7

Spring Data JDBC SQLFeatureNotSupportedException while saving list of enum to MySql

时间秒杀一切 提交于 2020-03-23 08:06:42
问题 I've a model named Role . A role has a list of Permission s, 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 https://github.com/tirbison/spring-data-jdbc-kotlin/tree/bug/mysql-list-of-enum to reproduce the bug, do not forget to change the mysql credentials. Role.kt package com.example.demo.domain.model import org.springframework.data.annotation.Id class Role( val name:

Spring Data JDBC SQLFeatureNotSupportedException while saving list of enum to MySql

…衆ロ難τιáo~ 提交于 2020-03-23 08:06:03
问题 I've a model named Role . A role has a list of Permission s, 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 https://github.com/tirbison/spring-data-jdbc-kotlin/tree/bug/mysql-list-of-enum to reproduce the bug, do not forget to change the mysql credentials. Role.kt package com.example.demo.domain.model import org.springframework.data.annotation.Id class Role( val name: