@@ -100,7 +100,7 @@ public DefaultDataAccessStrategy(SqlGeneratorSource sqlGeneratorSource, Relation
100
100
@ Override
101
101
public <T > Object insert (T instance , Class <T > domainType , Identifier identifier , boolean includeId ) {
102
102
103
- SqlIdentifierParameterSource parameterSource = sqlParametersFactory .getInsert (instance , domainType , identifier , includeId );
103
+ SqlIdentifierParameterSource parameterSource = sqlParametersFactory .forInsert (instance , domainType , identifier , includeId );
104
104
105
105
String insertSql = sql (domainType ).getInsert (parameterSource .getIdentifiers ());
106
106
@@ -112,7 +112,7 @@ public <T> Object[] insert(List<InsertSubject<T>> insertSubjects, Class<T> domai
112
112
113
113
Assert .notEmpty (insertSubjects , "Batch insert must contain at least one InsertSubject" );
114
114
SqlIdentifierParameterSource [] sqlParameterSources = insertSubjects .stream ()
115
- .map (insertSubject -> sqlParametersFactory .getInsert (insertSubject .getInstance (), domainType , insertSubject .getIdentifier (), includeId ))
115
+ .map (insertSubject -> sqlParametersFactory .forInsert (insertSubject .getInstance (), domainType , insertSubject .getIdentifier (), includeId ))
116
116
.toArray (SqlIdentifierParameterSource []::new );
117
117
118
118
String insertSql = sql (domainType ).getInsert (sqlParameterSources [0 ].getIdentifiers ());
@@ -126,7 +126,7 @@ public <T> Object[] insert(List<InsertSubject<T>> insertSubjects, Class<T> domai
126
126
*/
127
127
@ Override
128
128
public <S > boolean update (S instance , Class <S > domainType ) {
129
- return operations .update (sql (domainType ).getUpdate (), sqlParametersFactory .getUpdate (instance , domainType )) != 0 ;
129
+ return operations .update (sql (domainType ).getUpdate (), sqlParametersFactory .forUpdate (instance , domainType )) != 0 ;
130
130
}
131
131
132
132
/*
@@ -139,7 +139,7 @@ public <S> boolean updateWithVersion(S instance, Class<S> domainType, Number pre
139
139
RelationalPersistentEntity <S > persistentEntity = getRequiredPersistentEntity (domainType );
140
140
141
141
// Adjust update statement to set the new version and use the old version in where clause.
142
- SqlIdentifierParameterSource parameterSource = sqlParametersFactory .getUpdate (instance , domainType );
142
+ SqlIdentifierParameterSource parameterSource = sqlParametersFactory .forUpdate (instance , domainType );
143
143
parameterSource .addValue (VERSION_SQL_PARAMETER , previousVersion );
144
144
145
145
int affectedRows = operations .update (sql (domainType ).getUpdateWithVersion (), parameterSource );
@@ -161,7 +161,7 @@ public <S> boolean updateWithVersion(S instance, Class<S> domainType, Number pre
161
161
public void delete (Object id , Class <?> domainType ) {
162
162
163
163
String deleteByIdSql = sql (domainType ).getDeleteById ();
164
- SqlParameterSource parameter = sqlParametersFactory .getId (id , domainType , ID_SQL_PARAMETER );
164
+ SqlParameterSource parameter = sqlParametersFactory .forQueryById (id , domainType , ID_SQL_PARAMETER );
165
165
166
166
operations .update (deleteByIdSql , parameter );
167
167
}
@@ -177,7 +177,7 @@ public <T> void deleteWithVersion(Object id, Class<T> domainType, Number previou
177
177
178
178
RelationalPersistentEntity <T > persistentEntity = getRequiredPersistentEntity (domainType );
179
179
180
- SqlIdentifierParameterSource parameterSource = sqlParametersFactory .getId (id , domainType , ID_SQL_PARAMETER );
180
+ SqlIdentifierParameterSource parameterSource = sqlParametersFactory .forQueryById (id , domainType , ID_SQL_PARAMETER );
181
181
parameterSource .addValue (VERSION_SQL_PARAMETER , previousVersion );
182
182
int affectedRows = operations .update (sql (domainType ).getDeleteByIdAndVersion (), parameterSource );
183
183
@@ -202,7 +202,7 @@ public void delete(Object rootId, PersistentPropertyPath<RelationalPersistentPro
202
202
203
203
String delete = sql (rootEntity .getType ()).createDeleteByPath (propertyPath );
204
204
205
- SqlIdentifierParameterSource parameters = sqlParametersFactory .getId (rootId , rootEntity .getType (), ROOT_ID_PARAMETER );
205
+ SqlIdentifierParameterSource parameters = sqlParametersFactory .forQueryById (rootId , rootEntity .getType (), ROOT_ID_PARAMETER );
206
206
operations .update (delete , parameters );
207
207
}
208
208
@@ -233,7 +233,7 @@ public void deleteAll(PersistentPropertyPath<RelationalPersistentProperty> prope
233
233
public <T > void acquireLockById (Object id , LockMode lockMode , Class <T > domainType ) {
234
234
235
235
String acquireLockByIdSql = sql (domainType ).getAcquireLockById (lockMode );
236
- SqlIdentifierParameterSource parameter = sqlParametersFactory .getId (id , domainType , ID_SQL_PARAMETER );
236
+ SqlIdentifierParameterSource parameter = sqlParametersFactory .forQueryById (id , domainType , ID_SQL_PARAMETER );
237
237
238
238
operations .query (acquireLockByIdSql , parameter , ResultSet ::next );
239
239
}
@@ -272,7 +272,7 @@ public long count(Class<?> domainType) {
272
272
public <T > T findById (Object id , Class <T > domainType ) {
273
273
274
274
String findOneSql = sql (domainType ).getFindOne ();
275
- SqlIdentifierParameterSource parameter = sqlParametersFactory .getId (id , domainType , ID_SQL_PARAMETER );
275
+ SqlIdentifierParameterSource parameter = sqlParametersFactory .forQueryById (id , domainType , ID_SQL_PARAMETER );
276
276
277
277
try {
278
278
return operations .queryForObject (findOneSql , parameter , (RowMapper <T >) getEntityRowMapper (domainType ));
@@ -303,7 +303,7 @@ public <T> Iterable<T> findAllById(Iterable<?> ids, Class<T> domainType) {
303
303
return Collections .emptyList ();
304
304
}
305
305
306
- SqlParameterSource parameterSource = sqlParametersFactory .getIds (ids , domainType );
306
+ SqlParameterSource parameterSource = sqlParametersFactory .forQueryByIds (ids , domainType );
307
307
308
308
String findAllInListSql = sql (domainType ).getFindAllInList ();
309
309
@@ -331,7 +331,7 @@ public Iterable<Object> findAllByPath(Identifier identifier,
331
331
RowMapper <?> rowMapper = path .isMap () ? this .getMapEntityRowMapper (path , identifier )
332
332
: this .getEntityRowMapper (path , identifier );
333
333
334
- SqlParameterSource parameterSource = sqlParametersFactory .getIdentifier (identifier );
334
+ SqlParameterSource parameterSource = sqlParametersFactory .forQueryByIdentifier (identifier );
335
335
return operations .query (findAllByProperty , parameterSource , (RowMapper <Object >) rowMapper );
336
336
}
337
337
@@ -343,7 +343,7 @@ public Iterable<Object> findAllByPath(Identifier identifier,
343
343
public <T > boolean existsById (Object id , Class <T > domainType ) {
344
344
345
345
String existsSql = sql (domainType ).getExists ();
346
- SqlParameterSource parameter = sqlParametersFactory .getId (id , domainType , ID_SQL_PARAMETER );
346
+ SqlParameterSource parameter = sqlParametersFactory .forQueryById (id , domainType , ID_SQL_PARAMETER );
347
347
348
348
Boolean result = operations .queryForObject (existsSql , parameter , Boolean .class );
349
349
Assert .state (result != null , "The result of an exists query must not be null" );
0 commit comments