@@ -75,7 +75,7 @@ public class QPageRequest extends AbstractPageRequest {
|
||||
|
||||
super(page, size);
|
||||
|
||||
Assert.notNull(sort, "QSort must not be null!");
|
||||
Assert.notNull(sort, "QSort must not be null");
|
||||
|
||||
this.sort = sort;
|
||||
}
|
||||
|
||||
@@ -80,7 +80,7 @@ public class QSort extends Sort implements Serializable {
|
||||
*/
|
||||
private static List<Order> toOrders(List<OrderSpecifier<?>> orderSpecifiers) {
|
||||
|
||||
Assert.notNull(orderSpecifiers, "Order specifiers must not be null!");
|
||||
Assert.notNull(orderSpecifiers, "Order specifiers must not be null");
|
||||
|
||||
return orderSpecifiers.stream().map(QSort::toOrder).collect(Collectors.toList());
|
||||
}
|
||||
@@ -93,13 +93,13 @@ public class QSort extends Sort implements Serializable {
|
||||
*/
|
||||
private static Order toOrder(OrderSpecifier<?> orderSpecifier) {
|
||||
|
||||
Assert.notNull(orderSpecifier, "Order specifier must not be null!");
|
||||
Assert.notNull(orderSpecifier, "Order specifier must not be null");
|
||||
|
||||
Expression<?> target = orderSpecifier.getTarget();
|
||||
|
||||
Object targetElement = target instanceof Path ? preparePropertyPath((Path<?>) target) : target;
|
||||
|
||||
Assert.notNull(targetElement, "Target element must not be null!");
|
||||
Assert.notNull(targetElement, "Target element must not be null");
|
||||
|
||||
return Order.by(targetElement.toString()).with(orderSpecifier.isAscending() ? Direction.ASC : Direction.DESC);
|
||||
}
|
||||
@@ -136,7 +136,7 @@ public class QSort extends Sort implements Serializable {
|
||||
*/
|
||||
public QSort and(List<OrderSpecifier<?>> orderSpecifiers) {
|
||||
|
||||
Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty!");
|
||||
Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty");
|
||||
|
||||
List<OrderSpecifier<?>> newOrderSpecifiers = new ArrayList<>(this.orderSpecifiers);
|
||||
newOrderSpecifiers.addAll(orderSpecifiers);
|
||||
@@ -153,7 +153,7 @@ public class QSort extends Sort implements Serializable {
|
||||
*/
|
||||
public QSort and(OrderSpecifier<?>... orderSpecifiers) {
|
||||
|
||||
Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty!");
|
||||
Assert.notEmpty(orderSpecifiers, "OrderSpecifiers must not be null or empty");
|
||||
return and(Arrays.asList(orderSpecifiers));
|
||||
}
|
||||
|
||||
|
||||
@@ -49,8 +49,8 @@ public class QuerydslRepositoryInvokerAdapter implements RepositoryInvoker {
|
||||
public QuerydslRepositoryInvokerAdapter(RepositoryInvoker delegate, QuerydslPredicateExecutor<Object> executor,
|
||||
Predicate predicate) {
|
||||
|
||||
Assert.notNull(delegate, "Delegate RepositoryInvoker must not be null!");
|
||||
Assert.notNull(executor, "QuerydslPredicateExecutor must not be null!");
|
||||
Assert.notNull(delegate, "Delegate RepositoryInvoker must not be null");
|
||||
Assert.notNull(executor, "QuerydslPredicateExecutor must not be null");
|
||||
|
||||
this.delegate = delegate;
|
||||
this.executor = executor;
|
||||
|
||||
@@ -34,8 +34,8 @@ import com.querydsl.core.types.EntityPath;
|
||||
*/
|
||||
public class SimpleEntityPathResolver implements EntityPathResolver {
|
||||
|
||||
private static final String NO_CLASS_FOUND_TEMPLATE = "Did not find a query class %s for domain class %s!";
|
||||
private static final String NO_FIELD_FOUND_TEMPLATE = "Did not find a static field of the same type in %s!";
|
||||
private static final String NO_CLASS_FOUND_TEMPLATE = "Did not find a query class %s for domain class %s";
|
||||
private static final String NO_FIELD_FOUND_TEMPLATE = "Did not find a static field of the same type in %s";
|
||||
|
||||
public static final SimpleEntityPathResolver INSTANCE = new SimpleEntityPathResolver("");
|
||||
|
||||
@@ -48,7 +48,7 @@ public class SimpleEntityPathResolver implements EntityPathResolver {
|
||||
*/
|
||||
public SimpleEntityPathResolver(String querySuffix) {
|
||||
|
||||
Assert.notNull(querySuffix, "Query suffix must not be null!");
|
||||
Assert.notNull(querySuffix, "Query suffix must not be null");
|
||||
|
||||
this.querySuffix = querySuffix;
|
||||
}
|
||||
|
||||
@@ -127,7 +127,7 @@ public class QuerydslBindings {
|
||||
*/
|
||||
public final void excluding(Path<?>... paths) {
|
||||
|
||||
Assert.notEmpty(paths, "At least one path has to be provided!");
|
||||
Assert.notEmpty(paths, "At least one path has to be provided");
|
||||
|
||||
for (Path<?> path : paths) {
|
||||
this.denyList.add(toDotPath(Optional.of(path)));
|
||||
@@ -141,7 +141,7 @@ public class QuerydslBindings {
|
||||
*/
|
||||
public final void including(Path<?>... paths) {
|
||||
|
||||
Assert.notEmpty(paths, "At least one path has to be provided!");
|
||||
Assert.notEmpty(paths, "At least one path has to be provided");
|
||||
|
||||
for (Path<?> path : paths) {
|
||||
this.allowList.add(toDotPath(Optional.of(path)));
|
||||
@@ -172,8 +172,8 @@ public class QuerydslBindings {
|
||||
*/
|
||||
boolean isPathAvailable(String path, Class<?> type) {
|
||||
|
||||
Assert.notNull(path, "Path must not be null!");
|
||||
Assert.notNull(type, "Type must not be null!");
|
||||
Assert.notNull(path, "Path must not be null");
|
||||
Assert.notNull(type, "Type must not be null");
|
||||
|
||||
return isPathAvailable(path, ClassTypeInformation.from(type));
|
||||
}
|
||||
@@ -187,8 +187,8 @@ public class QuerydslBindings {
|
||||
*/
|
||||
boolean isPathAvailable(String path, TypeInformation<?> type) {
|
||||
|
||||
Assert.notNull(path, "Path must not be null!");
|
||||
Assert.notNull(type, "Type must not be null!");
|
||||
Assert.notNull(path, "Path must not be null");
|
||||
Assert.notNull(type, "Type must not be null");
|
||||
|
||||
return getPropertyPath(path, type) != null;
|
||||
}
|
||||
@@ -203,7 +203,7 @@ public class QuerydslBindings {
|
||||
@SuppressWarnings("unchecked")
|
||||
public <S extends Path<? extends T>, T> Optional<MultiValueBinding<S, T>> getBindingForPath(PathInformation path) {
|
||||
|
||||
Assert.notNull(path, "PropertyPath must not be null!");
|
||||
Assert.notNull(path, "PropertyPath must not be null");
|
||||
|
||||
PathAndBinding<S, T> pathAndBinding = (PathAndBinding<S, T>) pathSpecs.get(createKey(path));
|
||||
|
||||
@@ -229,7 +229,7 @@ public class QuerydslBindings {
|
||||
*/
|
||||
Optional<Path<?>> getExistingPath(PathInformation path) {
|
||||
|
||||
Assert.notNull(path, "PropertyPath must not be null!");
|
||||
Assert.notNull(path, "PropertyPath must not be null");
|
||||
|
||||
return Optional.ofNullable(pathSpecs.get(createKey(path))).flatMap(PathAndBinding::getPath);
|
||||
}
|
||||
@@ -244,8 +244,8 @@ public class QuerydslBindings {
|
||||
@Nullable
|
||||
PathInformation getPropertyPath(String path, TypeInformation<?> type) {
|
||||
|
||||
Assert.notNull(path, "Path must not be null!");
|
||||
Assert.notNull(type, "Type information must not be null!");
|
||||
Assert.notNull(path, "Path must not be null");
|
||||
Assert.notNull(type, "Type information must not be null");
|
||||
|
||||
if (!isPathVisible(path)) {
|
||||
return null;
|
||||
@@ -381,7 +381,7 @@ public class QuerydslBindings {
|
||||
@SafeVarargs
|
||||
PathBinder(P... paths) {
|
||||
|
||||
Assert.notEmpty(paths, "At least one path has to be provided!");
|
||||
Assert.notEmpty(paths, "At least one path has to be provided");
|
||||
this.paths = Arrays.asList(paths);
|
||||
}
|
||||
|
||||
@@ -392,14 +392,14 @@ public class QuerydslBindings {
|
||||
*/
|
||||
public void firstOptional(OptionalValueBinding<P, T> binding) {
|
||||
|
||||
Assert.notNull(binding, "Binding must not be null!");
|
||||
Assert.notNull(binding, "Binding must not be null");
|
||||
|
||||
all((path, value) -> binding.bind(path, Optionals.next(value.iterator())));
|
||||
}
|
||||
|
||||
public void first(SingleValueBinding<P, T> binding) {
|
||||
|
||||
Assert.notNull(binding, "Binding must not be null!");
|
||||
Assert.notNull(binding, "Binding must not be null");
|
||||
all((path, value) -> Optionals.next(value.iterator()).map(t -> binding.bind(path, t)));
|
||||
}
|
||||
|
||||
@@ -410,7 +410,7 @@ public class QuerydslBindings {
|
||||
*/
|
||||
public void all(MultiValueBinding<P, T> binding) {
|
||||
|
||||
Assert.notNull(binding, "Binding must not be null!");
|
||||
Assert.notNull(binding, "Binding must not be null");
|
||||
|
||||
paths.forEach(path -> registerBinding(PathAndBinding.withPath(path).with(binding)));
|
||||
}
|
||||
@@ -450,7 +450,7 @@ public class QuerydslBindings {
|
||||
|
||||
super(path);
|
||||
|
||||
Assert.notNull(path, "Path must not be null!");
|
||||
Assert.notNull(path, "Path must not be null");
|
||||
|
||||
this.alias = alias;
|
||||
this.path = path;
|
||||
@@ -466,7 +466,7 @@ public class QuerydslBindings {
|
||||
*/
|
||||
public AliasingPathBinder<P, T> as(String alias) {
|
||||
|
||||
Assert.hasText(alias, "Alias must not be null or empty!");
|
||||
Assert.hasText(alias, "Alias must not be null or empty");
|
||||
return new AliasingPathBinder<>(alias, path);
|
||||
}
|
||||
|
||||
@@ -512,13 +512,13 @@ public class QuerydslBindings {
|
||||
*/
|
||||
public <P extends Path<T>> void firstOptional(OptionalValueBinding<P, T> binding) {
|
||||
|
||||
Assert.notNull(binding, "Binding must not be null!");
|
||||
Assert.notNull(binding, "Binding must not be null");
|
||||
all((MultiValueBinding<P, T>) (path, value) -> binding.bind(path, Optionals.next(value.iterator())));
|
||||
}
|
||||
|
||||
public <P extends Path<T>> void first(SingleValueBinding<P, T> binding) {
|
||||
|
||||
Assert.notNull(binding, "Binding must not be null!");
|
||||
Assert.notNull(binding, "Binding must not be null");
|
||||
all((MultiValueBinding<P, T>) (path, value) -> Optionals.next(value.iterator()).map(t -> binding.bind(path, t)));
|
||||
}
|
||||
|
||||
@@ -529,7 +529,7 @@ public class QuerydslBindings {
|
||||
*/
|
||||
public <P extends Path<T>> void all(MultiValueBinding<P, T> binding) {
|
||||
|
||||
Assert.notNull(binding, "Binding must not be null!");
|
||||
Assert.notNull(binding, "Binding must not be null");
|
||||
|
||||
QuerydslBindings.this.typeSpecs.put(type, PathAndBinding.<T, P> withoutPath().with(binding));
|
||||
}
|
||||
|
||||
@@ -44,7 +44,7 @@ import com.querydsl.core.types.EntityPath;
|
||||
*/
|
||||
public class QuerydslBindingsFactory implements ApplicationContextAware {
|
||||
|
||||
private static final String INVALID_DOMAIN_TYPE = "Unable to find Querydsl root type for detected domain type %s! User @%s's root attribute to define the domain type manually!";
|
||||
private static final String INVALID_DOMAIN_TYPE = "Unable to find Querydsl root type for detected domain type %s; User @%s's root attribute to define the domain type manually";
|
||||
|
||||
private final EntityPathResolver entityPathResolver;
|
||||
private final Map<TypeInformation<?>, EntityPath<?>> entityPaths;
|
||||
@@ -60,7 +60,7 @@ public class QuerydslBindingsFactory implements ApplicationContextAware {
|
||||
*/
|
||||
public QuerydslBindingsFactory(EntityPathResolver entityPathResolver) {
|
||||
|
||||
Assert.notNull(entityPathResolver, "EntityPathResolver must not be null!");
|
||||
Assert.notNull(entityPathResolver, "EntityPathResolver must not be null");
|
||||
|
||||
this.entityPathResolver = entityPathResolver;
|
||||
this.entityPaths = new ConcurrentReferenceHashMap<>();
|
||||
@@ -122,8 +122,8 @@ public class QuerydslBindingsFactory implements ApplicationContextAware {
|
||||
private QuerydslBindings createBindingsFor(TypeInformation<?> domainType,
|
||||
Optional<Class<? extends QuerydslBinderCustomizer<?>>> customizer) {
|
||||
|
||||
Assert.notNull(customizer, "Customizer must not be null!");
|
||||
Assert.notNull(domainType, "Domain type must not be null!");
|
||||
Assert.notNull(customizer, "Customizer must not be null");
|
||||
Assert.notNull(domainType, "Domain type must not be null");
|
||||
|
||||
EntityPath<?> path = verifyEntityPathPresent(domainType);
|
||||
|
||||
|
||||
@@ -47,8 +47,8 @@ class QuerydslDefaultBinding implements MultiValueBinding<Path<? extends Object>
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public Optional<Predicate> bind(Path<?> path, Collection<? extends Object> value) {
|
||||
|
||||
Assert.notNull(path, "Path must not be null!");
|
||||
Assert.notNull(value, "Value must not be null!");
|
||||
Assert.notNull(path, "Path must not be null");
|
||||
Assert.notNull(value, "Value must not be null");
|
||||
|
||||
if (value.isEmpty()) {
|
||||
return Optional.empty();
|
||||
|
||||
@@ -66,7 +66,7 @@ public class QuerydslPredicateBuilder {
|
||||
*/
|
||||
public QuerydslPredicateBuilder(ConversionService conversionService, EntityPathResolver resolver) {
|
||||
|
||||
Assert.notNull(conversionService, "ConversionService must not be null!");
|
||||
Assert.notNull(conversionService, "ConversionService must not be null");
|
||||
|
||||
this.defaultBinding = new QuerydslDefaultBinding();
|
||||
this.conversionService = conversionService;
|
||||
@@ -85,7 +85,7 @@ public class QuerydslPredicateBuilder {
|
||||
*/
|
||||
public Predicate getPredicate(TypeInformation<?> type, MultiValueMap<String, ?> values, QuerydslBindings bindings) {
|
||||
|
||||
Assert.notNull(bindings, "Context must not be null!");
|
||||
Assert.notNull(bindings, "Context must not be null");
|
||||
|
||||
BooleanBuilder builder = new BooleanBuilder();
|
||||
|
||||
|
||||
Reference in New Issue
Block a user