|
|
|
|
@ -147,21 +147,16 @@ public class JdbcQueryMethod extends QueryMethod {
@@ -147,21 +147,16 @@ public class JdbcQueryMethod extends QueryMethod {
|
|
|
|
|
@Nullable |
|
|
|
|
private String getNamedQuery() { |
|
|
|
|
|
|
|
|
|
String name = getQueryName(); |
|
|
|
|
String name = getNamedQueryName(); |
|
|
|
|
return this.namedQueries.hasQuery(name) ? this.namedQueries.getQuery(name) : null; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the annotated query name. |
|
|
|
|
* |
|
|
|
|
* @return May be {@code null}. |
|
|
|
|
*/ |
|
|
|
|
|
|
|
|
|
private String getQueryName() { |
|
|
|
|
@Override |
|
|
|
|
public String getNamedQueryName() { |
|
|
|
|
|
|
|
|
|
String annotatedName = getMergedAnnotationAttribute("name"); |
|
|
|
|
|
|
|
|
|
return StringUtils.hasText(annotatedName) ? annotatedName : getNamedQueryName(); |
|
|
|
|
return StringUtils.hasText(annotatedName) ? annotatedName : super.getNamedQueryName(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
@ -174,7 +169,6 @@ public class JdbcQueryMethod extends QueryMethod {
@@ -174,7 +169,6 @@ public class JdbcQueryMethod extends QueryMethod {
|
|
|
|
|
return getMergedAnnotationAttribute("rowMapperClass"); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the name of the bean to be used as {@link org.springframework.jdbc.core.RowMapper} |
|
|
|
|
* |
|
|
|
|
@ -225,24 +219,11 @@ public class JdbcQueryMethod extends QueryMethod {
@@ -225,24 +219,11 @@ public class JdbcQueryMethod extends QueryMethod {
|
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns whether the method has an annotated query. |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
public boolean hasAnnotatedQuery() { |
|
|
|
|
return findAnnotatedQuery().isPresent(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Returns the query string declared in a {@link Query} annotation or {@literal null} if neither the annotation found |
|
|
|
|
* nor the attribute was specified. |
|
|
|
|
* |
|
|
|
|
* @return |
|
|
|
|
*/ |
|
|
|
|
@Nullable |
|
|
|
|
String getAnnotatedQuery() { |
|
|
|
|
return findAnnotatedQuery().orElse(null); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
private Optional<String> findAnnotatedQuery() { |
|
|
|
|
|
|
|
|
|
return lookupQueryAnnotation() //
|
|
|
|
|
|