1515 */
1616package org .springframework .data .jdbc .core ;
1717
18- import static org .assertj .core .api .Assertions .*;
19-
2018import java .util .Map ;
2119import java .util .Set ;
2220
2321import org .assertj .core .api .SoftAssertions ;
2422import org .junit .Before ;
2523import org .junit .Test ;
24+
2625import org .springframework .data .annotation .Id ;
2726import org .springframework .data .jdbc .mapping .model .DefaultNamingStrategy ;
2827import org .springframework .data .jdbc .mapping .model .JdbcMappingContext ;
3130import org .springframework .data .jdbc .mapping .model .NamingStrategy ;
3231import org .springframework .data .mapping .PropertyPath ;
3332
33+ import static org .assertj .core .api .Assertions .*;
34+
3435/**
3536 * Unit tests for the {@link SqlGenerator}.
3637 *
@@ -115,9 +116,9 @@ public void findAllByProperty() {
115116 // this would get called when DummyEntity is the element type of a Set
116117 String sql = sqlGenerator .getFindAllByProperty ("back-ref" , null );
117118
118- assertThat (sql ).isEqualTo ("SELECT DummyEntity.id AS id , DummyEntity.name AS name , "
119- + "ref.l1id AS ref_l1id , ref.content AS ref_content , ref.further AS ref_further "
120- + "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.id "
119+ assertThat (sql ).isEqualTo ("SELECT DummyEntity.x_id AS x_id , DummyEntity.x_name AS x_name , "
120+ + "ref.x_l1id AS ref_x_l1id , ref.x_content AS ref_x_content , ref.x_further AS ref_x_further "
121+ + "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.x_id "
121122 + "WHERE back-ref = :back-ref" );
122123 }
123124
@@ -127,10 +128,10 @@ public void findAllByPropertyWithKey() {
127128 // this would get called when DummyEntity is th element type of a Map
128129 String sql = sqlGenerator .getFindAllByProperty ("back-ref" , "key-column" );
129130
130- assertThat (sql ).isEqualTo ("SELECT DummyEntity.id AS id , DummyEntity.name AS name , "
131- + "ref.l1id AS ref_l1id , ref.content AS ref_content , ref.further AS ref_further , "
131+ assertThat (sql ).isEqualTo ("SELECT DummyEntity.x_id AS x_id , DummyEntity.x_name AS x_name , "
132+ + "ref.x_l1id AS ref_x_l1id , ref.x_content AS ref_x_content , ref.x_further AS ref_x_further , "
132133 + "DummyEntity.key-column AS key-column "
133- + "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.id "
134+ + "FROM DummyEntity LEFT OUTER JOIN ReferencedEntity AS ref ON ref.DummyEntity = DummyEntity.x_id "
134135 + "WHERE back-ref = :back-ref" );
135136 }
136137
0 commit comments