Fixed Findbugs issues.
This commit is contained in:
@@ -63,7 +63,7 @@ public class JpaCountQueryCreator extends JpaQueryCreator {
|
||||
* javax.persistence.criteria.CriteriaBuilder)
|
||||
*/
|
||||
@Override
|
||||
protected CriteriaQuery<Object> finalize(Predicate predicate, Sort sort,
|
||||
protected CriteriaQuery<Object> complete(Predicate predicate, Sort sort,
|
||||
CriteriaQuery<Object> query, CriteriaBuilder builder) {
|
||||
|
||||
return query.select(builder.count(query.from(domainClass)));
|
||||
|
||||
@@ -114,14 +114,14 @@ public class JpaQueryCreator extends
|
||||
/**
|
||||
* Finalizes the given {@link Predicate} and applies the given sort.
|
||||
* Delegates to
|
||||
* {@link #finalize(Predicate, Sort, CriteriaQuery, CriteriaBuilder)} and
|
||||
* {@link #complete(Predicate, Sort, CriteriaQuery, CriteriaBuilder)} and
|
||||
* hands it the current {@link CriteriaQuery} and {@link CriteriaBuilder}.
|
||||
*/
|
||||
@Override
|
||||
protected final CriteriaQuery<Object> finalize(Predicate predicate,
|
||||
protected final CriteriaQuery<Object> complete(Predicate predicate,
|
||||
Sort sort) {
|
||||
|
||||
return finalize(predicate, sort, query, builder);
|
||||
return complete(predicate, sort, query, builder);
|
||||
}
|
||||
|
||||
|
||||
@@ -135,7 +135,7 @@ public class JpaQueryCreator extends
|
||||
* @param builder
|
||||
* @return
|
||||
*/
|
||||
protected CriteriaQuery<Object> finalize(Predicate predicate, Sort sort,
|
||||
protected CriteriaQuery<Object> complete(Predicate predicate, Sort sort,
|
||||
CriteriaQuery<Object> query, CriteriaBuilder builder) {
|
||||
|
||||
return this.query.select(root).where(predicate)
|
||||
|
||||
@@ -30,7 +30,14 @@ import org.springframework.data.repository.query.RepositoryQuery;
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
public class JpaQueryLookupStrategy {
|
||||
public final class JpaQueryLookupStrategy {
|
||||
|
||||
/**
|
||||
* Private constructor to prevent instantiation.
|
||||
*/
|
||||
private JpaQueryLookupStrategy() {
|
||||
|
||||
}
|
||||
|
||||
/**
|
||||
* Base class for {@link QueryLookupStrategy} implementations that need
|
||||
@@ -38,7 +45,7 @@ public class JpaQueryLookupStrategy {
|
||||
*
|
||||
* @author Oliver Gierke
|
||||
*/
|
||||
private static abstract class AbstractQueryLookupStrategy implements
|
||||
private abstract static class AbstractQueryLookupStrategy implements
|
||||
QueryLookupStrategy {
|
||||
|
||||
private final EntityManager em;
|
||||
@@ -195,7 +202,7 @@ public class JpaQueryLookupStrategy {
|
||||
return new CreateIfNotFoundQueryLookupStrategy(em, extractor);
|
||||
default:
|
||||
throw new IllegalArgumentException(String.format(
|
||||
"Unsupported query lookup strategy %!", key));
|
||||
"Unsupported query lookup strategy %s!", key));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -113,7 +113,7 @@ public class JpaQueryMethod extends QueryMethod {
|
||||
*
|
||||
* @return
|
||||
*/
|
||||
boolean isModifyingQuery() {
|
||||
final boolean isModifyingQuery() {
|
||||
|
||||
return null != AnnotationUtils.findAnnotation(method, Modifying.class);
|
||||
}
|
||||
|
||||
@@ -51,7 +51,7 @@ public class ParameterBinder {
|
||||
"Invalid number of parameters given!");
|
||||
|
||||
this.parameters = parameters;
|
||||
this.values = values;
|
||||
this.values = values.clone();
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -28,6 +28,14 @@ import org.springframework.util.StringUtils;
|
||||
*/
|
||||
public abstract class JpaClassUtils {
|
||||
|
||||
/**
|
||||
* Private constructor to prevent instantiation.
|
||||
*/
|
||||
private JpaClassUtils() {
|
||||
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Returns whether the given {@link EntityManager} is of the given type.
|
||||
*
|
||||
|
||||
Reference in New Issue
Block a user