From 7929feaa40f966dd38323673d84fc47780035395 Mon Sep 17 00:00:00 2001 From: Oliver Gierke Date: Mon, 29 Jun 2015 17:24:59 +0200 Subject: [PATCH] DATACMNS-293 - Polished AnnotationBasedQueryAugmentor. MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Renamed variables to better express what they stand for. Added hook to forward augmentNativeQuery(…) to prepareNativeQuery(…). --- .../AnnotationBasedQueryAugmentor.java | 24 ++++++++++++------- 1 file changed, 16 insertions(+), 8 deletions(-) diff --git a/src/main/java/org/springframework/data/repository/augment/AnnotationBasedQueryAugmentor.java b/src/main/java/org/springframework/data/repository/augment/AnnotationBasedQueryAugmentor.java index 60d3143f0..9ec1498ac 100644 --- a/src/main/java/org/springframework/data/repository/augment/AnnotationBasedQueryAugmentor.java +++ b/src/main/java/org/springframework/data/repository/augment/AnnotationBasedQueryAugmentor.java @@ -103,11 +103,11 @@ public abstract class AnnotationBasedQueryAugmentor type, Method method) { - T expression = AnnotationUtils.findAnnotation(type, annotationType); + T annotation = AnnotationUtils.findAnnotation(type, annotationType); - if (expression != null) { - cache.put(method, expression); - return expression; + if (annotation != null) { + cache.put(method, annotation); + return annotation; } return null; @@ -118,7 +118,15 @@ public abstract class AnnotationBasedQueryAugmentor