@@ -89,92 +89,92 @@ void findOne() {
89
89
@ Test // GH-574
90
90
void findOneWrappedId () {
91
91
92
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithWrappedId .class );
92
+ SqlGenerator sqlGenerator = createSqlGenerator (WithWrappedId .class );
93
93
94
94
String sql = sqlGenerator .getFindOne ();
95
95
96
96
assertSoftly (softly -> {
97
97
98
98
softly .assertThat (sql ).startsWith ("SELECT" ) //
99
- .contains ("dummy_entity_with_wrapped_id .name AS name" ) //
100
- .contains ("dummy_entity_with_wrapped_id .id" ) //
101
- .contains ("WHERE dummy_entity_with_wrapped_id .id = :id" );
99
+ .contains ("with_wrapped_id .name AS name" ) //
100
+ .contains ("with_wrapped_id .id" ) //
101
+ .contains ("WHERE with_wrapped_id .id = :id" );
102
102
});
103
103
}
104
104
105
105
@ Test // GH-574
106
106
void findOneEmbeddedId () {
107
107
108
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedId .class );
108
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedId .class );
109
109
110
110
String sql = sqlGenerator .getFindOne ();
111
111
112
112
assertSoftly (softly -> {
113
113
114
114
softly .assertThat (sql ).startsWith ("SELECT" ) //
115
- .contains ("dummy_entity_with_embedded_id .name AS name" ) //
116
- .contains ("dummy_entity_with_embedded_id .one" ) //
117
- .contains ("dummy_entity_with_embedded_id .two" ) //
115
+ .contains ("with_embedded_id .name AS name" ) //
116
+ .contains ("with_embedded_id .one" ) //
117
+ .contains ("with_embedded_id .two" ) //
118
118
.contains (" WHERE " ) //
119
- .contains ("dummy_entity_with_embedded_id .one = :one" ) //
120
- .contains ("dummy_entity_with_embedded_id .two = :two" );
119
+ .contains ("with_embedded_id .one = :one" ) //
120
+ .contains ("with_embedded_id .two = :two" );
121
121
});
122
122
}
123
123
124
124
@ Test // GH-574
125
125
void deleteByIdEmbeddedId () {
126
126
127
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedId .class );
127
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedId .class );
128
128
129
129
String sql = sqlGenerator .getDeleteById ();
130
130
131
131
assertSoftly (softly -> {
132
132
133
133
softly .assertThat (sql ).startsWith ("DELETE" ) //
134
134
.contains (" WHERE " ) //
135
- .contains ("dummy_entity_with_embedded_id .one = :one" ) //
136
- .contains ("dummy_entity_with_embedded_id .two = :two" );
135
+ .contains ("with_embedded_id .one = :one" ) //
136
+ .contains ("with_embedded_id .two = :two" );
137
137
});
138
138
}
139
139
140
140
@ Test // GH-574
141
141
void deleteByIdInEmbeddedId () {
142
142
143
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedId .class );
143
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedId .class );
144
144
145
145
String sql = sqlGenerator .getDeleteByIdIn ();
146
146
147
147
assertSoftly (softly -> {
148
148
149
149
softly .assertThat (sql ).startsWith ("DELETE" ) //
150
150
.contains (" WHERE " ) //
151
- .contains ("(dummy_entity_with_embedded_id .one, dummy_entity_with_embedded_id .two) IN (:ids)" );
151
+ .contains ("(with_embedded_id .one, with_embedded_id .two) IN (:ids)" );
152
152
});
153
153
}
154
154
155
155
@ Test // GH-574
156
156
void deleteByPathEmbeddedId () {
157
157
158
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedId .class );
158
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedId .class );
159
159
PersistentPropertyPath <RelationalPersistentProperty > path = PersistentPropertyPathTestUtils .getPath ("other" ,
160
- DummyEntityWithEmbeddedIdAndReference .class , context );
160
+ WithEmbeddedIdAndReference .class , context );
161
161
162
162
String sql = sqlGenerator .createDeleteByPath (path );
163
163
164
164
assertSoftly (softly -> {
165
165
166
166
softly .assertThat (sql ).startsWith ("DELETE FROM other_entity WHERE" ) //
167
- .contains ("other_entity.dummy_entity_with_embedded_id_and_reference_one = :one" ) //
168
- .contains ("other_entity.dummy_entity_with_embedded_id_and_reference_two = :two" );
167
+ .contains ("other_entity.with_embedded_id_and_reference_one = :one" ) //
168
+ .contains ("other_entity.with_embedded_id_and_reference_two = :two" );
169
169
});
170
170
}
171
171
172
172
@ Test // GH-574
173
173
void deleteInByPathEmbeddedId () {
174
174
175
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedId .class );
175
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedId .class );
176
176
PersistentPropertyPath <RelationalPersistentProperty > path = PersistentPropertyPathTestUtils .getPath ("other" ,
177
- DummyEntityWithEmbeddedIdAndReference .class , context );
177
+ WithEmbeddedIdAndReference .class , context );
178
178
179
179
String sql = sqlGenerator .createDeleteInByPath (path );
180
180
@@ -183,39 +183,39 @@ void deleteInByPathEmbeddedId() {
183
183
softly .assertThat (sql ).startsWith ("DELETE FROM other_entity WHERE" ) //
184
184
.contains (" WHERE " ) //
185
185
.contains (
186
- "(other_entity.dummy_entity_with_embedded_id_and_reference_one , other_entity.dummy_entity_with_embedded_id_and_reference_two ) IN (:ids)" );
186
+ "(other_entity.with_embedded_id_and_reference_one , other_entity.with_embedded_id_and_reference_two ) IN (:ids)" );
187
187
});
188
188
}
189
189
190
190
@ Test // GH-574
191
191
void updateWithEmbeddedId () {
192
192
193
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedId .class );
193
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedId .class );
194
194
195
195
String sql = sqlGenerator .getUpdate ();
196
196
197
197
assertSoftly (softly -> {
198
198
199
199
softly .assertThat (sql ).startsWith ("UPDATE" ) //
200
200
.contains (" WHERE " ) //
201
- .contains ("dummy_entity_with_embedded_id .one = :one" ) //
202
- .contains ("dummy_entity_with_embedded_id .two = :two" );
201
+ .contains ("with_embedded_id .one = :one" ) //
202
+ .contains ("with_embedded_id .two = :two" );
203
203
});
204
204
}
205
205
206
206
@ Test // GH-574
207
207
void existsByIdEmbeddedId () {
208
208
209
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedId .class );
209
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedId .class );
210
210
211
211
String sql = sqlGenerator .getExists ();
212
212
213
213
assertSoftly (softly -> {
214
214
215
215
softly .assertThat (sql ).startsWith ("SELECT COUNT" ) //
216
216
.contains (" WHERE " ) //
217
- .contains ("dummy_entity_with_embedded_id .one = :one" ) //
218
- .contains ("dummy_entity_with_embedded_id .two = :two" );
217
+ .contains ("with_embedded_id .one = :one" ) //
218
+ .contains ("with_embedded_id .two = :two" );
219
219
});
220
220
}
221
221
@@ -269,24 +269,24 @@ void findAllInList() {
269
269
@ Test // GH-574
270
270
void findAllInListEmbeddedId () {
271
271
272
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedId .class );
272
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedId .class );
273
273
274
274
String sql = sqlGenerator .getFindAllInList ();
275
275
276
276
assertSoftly (softly -> {
277
277
278
278
softly .assertThat (sql ).startsWith ("SELECT" ) //
279
- .contains ("dummy_entity_with_embedded_id .name AS name" ) //
280
- .contains ("dummy_entity_with_embedded_id .one" ) //
281
- .contains ("dummy_entity_with_embedded_id .two" ) //
282
- .contains (" WHERE (dummy_entity_with_embedded_id .one, dummy_entity_with_embedded_id .two) IN (:ids)" );
279
+ .contains ("with_embedded_id .name AS name" ) //
280
+ .contains ("with_embedded_id .one" ) //
281
+ .contains ("with_embedded_id .two" ) //
282
+ .contains (" WHERE (with_embedded_id .one, with_embedded_id .two) IN (:ids)" );
283
283
});
284
284
}
285
285
286
286
@ Test // GH-574
287
287
void findOneWithReference () {
288
288
289
- SqlGenerator sqlGenerator = createSqlGenerator (DummyEntityWithEmbeddedIdAndReference .class );
289
+ SqlGenerator sqlGenerator = createSqlGenerator (WithEmbeddedIdAndReference .class );
290
290
291
291
String sql = sqlGenerator .getFindOne ();
292
292
@@ -296,12 +296,12 @@ void findOneWithReference() {
296
296
.contains (" LEFT OUTER JOIN other_entity other " ) //
297
297
.contains (" ON " ) //
298
298
.contains (
299
- " other.dummy_entity_with_embedded_id_and_reference_one = dummy_entity_with_embedded_id_and_reference .one " ) //
299
+ " other.with_embedded_id_and_reference_one = with_embedded_id_and_reference .one " ) //
300
300
.contains (
301
- " other.dummy_entity_with_embedded_id_and_reference_two = dummy_entity_with_embedded_id_and_reference .two " ) //
301
+ " other.with_embedded_id_and_reference_two = with_embedded_id_and_reference .two " ) //
302
302
.contains (" WHERE " ) //
303
- .contains ("dummy_entity_with_embedded_id_and_reference .one = :one" ) //
304
- .contains ("dummy_entity_with_embedded_id_and_reference .two = :two" );
303
+ .contains ("with_embedded_id_and_reference .one = :one" ) //
304
+ .contains ("with_embedded_id_and_reference .two = :two" );
305
305
});
306
306
}
307
307
@@ -502,7 +502,7 @@ static class DummyEntity {
502
502
record WrappedId (Long id ) {
503
503
}
504
504
505
- static class DummyEntityWithWrappedId {
505
+ static class WithWrappedId {
506
506
507
507
@ Id
508
508
@ Embedded (onEmpty = OnEmpty .USE_NULL ) WrappedId wrappedId ;
@@ -513,7 +513,7 @@ static class DummyEntityWithWrappedId {
513
513
record EmbeddedId (Long one , String two ) {
514
514
}
515
515
516
- static class DummyEntityWithEmbeddedId {
516
+ static class WithEmbeddedId {
517
517
518
518
@ Id
519
519
@ Embedded (onEmpty = OnEmpty .USE_NULL ) EmbeddedId embeddedId ;
@@ -522,7 +522,7 @@ static class DummyEntityWithEmbeddedId {
522
522
523
523
}
524
524
525
- static class DummyEntityWithEmbeddedIdAndReference {
525
+ static class WithEmbeddedIdAndReference {
526
526
527
527
@ Id
528
528
@ Embedded (onEmpty = OnEmpty .USE_NULL ) EmbeddedId embeddedId ;
0 commit comments