Skip to content

Commit 7cca9ee

Browse files
committed
Create fail on derived query
1 parent ca45cd5 commit 7cca9ee

File tree

2 files changed

+3
-2
lines changed

2 files changed

+3
-2
lines changed

spring-data-jdbc/src/test/java/org/springframework/data/jdbc/repository/JdbcRepositoryWithCollectionsChainHsqlIntegrationTests.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,7 @@
1717
import org.springframework.data.jdbc.testing.EnabledOnDatabase;
1818
import org.springframework.data.jdbc.testing.IntegrationTest;
1919
import org.springframework.data.jdbc.testing.TestConfiguration;
20+
import org.springframework.data.relational.core.mapping.Column;
2021
import org.springframework.data.repository.CrudRepository;
2122
import org.springframework.jdbc.core.namedparam.NamedParameterJdbcTemplate;
2223

@@ -109,7 +110,7 @@ static class ChildElement {
109110

110111
String name;
111112
Set<GrandChildElement> content = new HashSet<>();
112-
@Id private Long id;
113+
@Id @Column("CHILD_ID") private Long id;
113114
}
114115

115116
static class GrandChildElement {

spring-data-jdbc/src/test/resources/org.springframework.data.jdbc.repository/JdbcRepositoryWithCollectionsChainHsqlIntegrationTests-hsql.sql

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ CREATE TABLE DUMMY_ENTITY
55
);
66
CREATE TABLE CHILD_ELEMENT
77
(
8-
ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY,
8+
CHILD_ID BIGINT GENERATED BY DEFAULT AS IDENTITY (START WITH 1) PRIMARY KEY,
99
NAME VARCHAR(100),
1010
DUMMY_ENTITY BIGINT
1111
);

0 commit comments

Comments
 (0)