@@ -87,15 +87,15 @@ public void findOne() {
87
87
@ Test // DATAJDBC-112
88
88
public void cascadingDeleteFirstLevel () {
89
89
90
- String sql = sqlGenerator .createDeleteByPath (getPath ("ref" , DummyEntity . class ));
90
+ String sql = sqlGenerator .createDeleteByPath (getPath ("ref" ));
91
91
92
92
assertThat (sql ).isEqualTo ("DELETE FROM referenced_entity WHERE dummy_entity = :rootId" );
93
93
}
94
94
95
95
@ Test // DATAJDBC-112
96
96
public void cascadingDeleteAllSecondLevel () {
97
97
98
- String sql = sqlGenerator .createDeleteByPath (getPath ("ref.further" , DummyEntity . class ));
98
+ String sql = sqlGenerator .createDeleteByPath (getPath ("ref.further" ));
99
99
100
100
assertThat (sql ).isEqualTo (
101
101
"DELETE FROM second_level_referenced_entity WHERE referenced_entity IN (SELECT x_l1id FROM referenced_entity WHERE dummy_entity = :rootId)" );
@@ -112,15 +112,15 @@ public void deleteAll() {
112
112
@ Test // DATAJDBC-112
113
113
public void cascadingDeleteAllFirstLevel () {
114
114
115
- String sql = sqlGenerator .createDeleteAllSql (getPath ("ref" , DummyEntity . class ));
115
+ String sql = sqlGenerator .createDeleteAllSql (getPath ("ref" ));
116
116
117
117
assertThat (sql ).isEqualTo ("DELETE FROM referenced_entity WHERE dummy_entity IS NOT NULL" );
118
118
}
119
119
120
120
@ Test // DATAJDBC-112
121
121
public void cascadingDeleteSecondLevel () {
122
122
123
- String sql = sqlGenerator .createDeleteAllSql (getPath ("ref.further" , DummyEntity . class ));
123
+ String sql = sqlGenerator .createDeleteAllSql (getPath ("ref.further" ));
124
124
125
125
assertThat (sql ).isEqualTo (
126
126
"DELETE FROM second_level_referenced_entity WHERE referenced_entity IN (SELECT x_l1id FROM referenced_entity WHERE dummy_entity IS NOT NULL)" );
@@ -129,15 +129,15 @@ public void cascadingDeleteSecondLevel() {
129
129
@ Test // DATAJDBC-227
130
130
public void deleteAllMap () {
131
131
132
- String sql = sqlGenerator .createDeleteAllSql (getPath ("mappedElements" , DummyEntity . class ));
132
+ String sql = sqlGenerator .createDeleteAllSql (getPath ("mappedElements" ));
133
133
134
134
assertThat (sql ).isEqualTo ("DELETE FROM element WHERE dummy_entity IS NOT NULL" );
135
135
}
136
136
137
137
@ Test // DATAJDBC-227
138
138
public void deleteMapByPath () {
139
139
140
- String sql = sqlGenerator .createDeleteByPath (getPath ("mappedElements" , DummyEntity . class ));
140
+ String sql = sqlGenerator .createDeleteByPath (getPath ("mappedElements" ));
141
141
142
142
assertThat (sql ).isEqualTo ("DELETE FROM element WHERE dummy_entity = :rootId" );
143
143
}
@@ -177,7 +177,7 @@ public void findAllByPropertyWithKey() {
177
177
178
178
@ Test (expected = IllegalArgumentException .class ) // DATAJDBC-130
179
179
public void findAllByPropertyOrderedWithoutKey () {
180
- String sql = sqlGenerator .getFindAllByProperty ("back-ref" , null , true );
180
+ sqlGenerator .getFindAllByProperty ("back-ref" , null , true );
181
181
}
182
182
183
183
@ Test // DATAJDBC-131, DATAJDBC-111
@@ -209,6 +209,7 @@ public void getInsertForEmptyColumnList() {
209
209
210
210
@ Test // DATAJDBC-334
211
211
public void getInsertForQuotedColumnName () {
212
+
212
213
SqlGenerator sqlGenerator = createSqlGenerator (EntityWithQuotedColumnName .class );
213
214
214
215
String insert = sqlGenerator .getInsert (emptySet ());
@@ -254,6 +255,7 @@ public void readOnlyPropertyExcludedFromQuery_when_generateUpdateSql() {
254
255
255
256
@ Test // DATAJDBC-334
256
257
public void getUpdateForQuotedColumnName () {
258
+
257
259
SqlGenerator sqlGenerator = createSqlGenerator (EntityWithQuotedColumnName .class );
258
260
259
261
String update = sqlGenerator .getUpdate ();
@@ -332,8 +334,8 @@ public void readOnlyPropertyIncludedIntoQuery_when_generateFindOneSql() {
332
334
);
333
335
}
334
336
335
- private PersistentPropertyPath <RelationalPersistentProperty > getPath (String path , Class <?> base ) {
336
- return PersistentPropertyPathTestUtils .getPath (context , path , base );
337
+ private PersistentPropertyPath <RelationalPersistentProperty > getPath (String path ) {
338
+ return PersistentPropertyPathTestUtils .getPath (context , path , DummyEntity . class );
337
339
}
338
340
339
341
@ SuppressWarnings ("unused" )
@@ -368,7 +370,9 @@ static class Element {
368
370
String content ;
369
371
}
370
372
373
+ @ SuppressWarnings ("unused" )
371
374
static class ParentOfNoIdChild {
375
+
372
376
@ Id Long id ;
373
377
NoIdChild child ;
374
378
}
@@ -395,6 +399,7 @@ static class IdOnlyEntity {
395
399
@ Id Long id ;
396
400
}
397
401
402
+ @ SuppressWarnings ("unused" )
398
403
static class EntityWithReadOnlyProperty {
399
404
400
405
@ Id Long id ;
@@ -403,6 +408,7 @@ static class EntityWithReadOnlyProperty {
403
408
}
404
409
405
410
static class EntityWithQuotedColumnName {
411
+
406
412
@ Id @ Column ("\" test_@id\" " ) Long id ;
407
413
@ Column ("\" test_@123\" " ) String name ;
408
414
}
0 commit comments