File tree 3 files changed +5
-9
lines changed
spring-data-jpa/src/main/java/org/springframework/data/jpa/repository/support 3 files changed +5
-9
lines changed Original file line number Diff line number Diff line change 33
33
* @author Mark Paluch
34
34
* @author Jens Schauder
35
35
* @author Greg Turnquist
36
+ * @author Yanming Zhou
36
37
*/
37
38
public interface CrudMethodMetadata {
38
39
@@ -66,6 +67,7 @@ public interface CrudMethodMetadata {
66
67
* @return
67
68
* @since 3.0
68
69
*/
70
+ @ Nullable
69
71
String getComment ();
70
72
71
73
/**
Original file line number Diff line number Diff line change 56
56
* @author Christoph Strobl
57
57
* @author Mark Paluch
58
58
* @author Jens Schauder
59
+ * @author Yanming Zhou
59
60
*/
60
61
class CrudMethodMetadataPostProcessor implements RepositoryProxyPostProcessor , BeanClassLoaderAware {
61
62
@@ -181,7 +182,7 @@ private static class DefaultCrudMethodMetadata implements CrudMethodMetadata {
181
182
private final @ Nullable LockModeType lockModeType ;
182
183
private final org .springframework .data .jpa .repository .support .QueryHints queryHints ;
183
184
private final org .springframework .data .jpa .repository .support .QueryHints queryHintsForCount ;
184
- private final String comment ;
185
+ private final @ Nullable String comment ;
185
186
private final Optional <EntityGraph > entityGraph ;
186
187
private final Method method ;
187
188
Original file line number Diff line number Diff line change @@ -370,14 +370,7 @@ public boolean existsById(ID id) {
370
370
371
371
TypedQuery <Long > query = em .createQuery (existsQuery , Long .class );
372
372
373
- Map <String , Object > hints = new HashMap <>();
374
- getQueryHints ().withFetchGraphs (em ).forEach (hints ::put );
375
-
376
- if (metadata .getComment () != null && provider .getCommentHintKey () != null ) {
377
- hints .put (provider .getCommentHintKey (), provider .getCommentHintValue (metadata .getComment ()));
378
- }
379
-
380
- hints .forEach (query ::setHint );
373
+ applyQueryHints (query );
381
374
382
375
if (!entityInformation .hasCompositeId ()) {
383
376
query .setParameter (idAttributeNames .iterator ().next (), id );
You can’t perform that action at this time.
0 commit comments