DATACMNS-670 - Upgraded to Querydsl 4.

Switched to new Querydsl 4 artifacts and adapted to changed package names and API changes.

Cleaned up some JavaDoc and APIs in QuerydslBindingsFactory and QuerydslBinderCustomizer.
This commit is contained in:
Oliver Gierke
2015-05-22 17:27:00 +02:00
parent db2a09192b
commit c013c71e7a
29 changed files with 123 additions and 95 deletions

View File

@@ -30,7 +30,7 @@ import org.springframework.data.web.querydsl.QuerydslPredicateArgumentResolver;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.servlet.config.annotation.WebMvcConfigurerAdapter;
import com.mysema.query.types.Predicate;
import com.querydsl.core.types.Predicate;
/**
* Querydsl-specific web configuration for Spring Data. Registers a {@link HandlerMethodArgumentResolver} that builds up

View File

@@ -35,7 +35,7 @@ import org.springframework.web.context.request.NativeWebRequest;
import org.springframework.web.method.support.HandlerMethodArgumentResolver;
import org.springframework.web.method.support.ModelAndViewContainer;
import com.mysema.query.types.Predicate;
import com.querydsl.core.types.Predicate;
/**
* {@link HandlerMethodArgumentResolver} to allow injection of {@link com.mysema.query.types.Predicate} into Spring MVC
@@ -88,6 +88,7 @@ public class QuerydslPredicateArgumentResolver implements HandlerMethodArgumentR
* @see org.springframework.web.method.support.HandlerMethodArgumentResolver#resolveArgument(org.springframework.core.MethodParameter, org.springframework.web.method.support.ModelAndViewContainer, org.springframework.web.context.request.NativeWebRequest, org.springframework.web.bind.support.WebDataBinderFactory)
*/
@Override
@SuppressWarnings("unchecked")
public Predicate resolveArgument(MethodParameter parameter, ModelAndViewContainer mavContainer,
NativeWebRequest webRequest, WebDataBinderFactory binderFactory) throws Exception {
@@ -100,7 +101,8 @@ public class QuerydslPredicateArgumentResolver implements HandlerMethodArgumentR
QuerydslPredicate annotation = parameter.getParameterAnnotation(QuerydslPredicate.class);
TypeInformation<?> domainType = extractTypeInfo(parameter).getActualType();
Class<? extends QuerydslBinderCustomizer> customizer = annotation == null ? null : annotation.bindings();
Class<? extends QuerydslBinderCustomizer<?>> customizer = (Class<? extends QuerydslBinderCustomizer<?>>) (annotation == null
? null : annotation.bindings());
QuerydslBindings bindings = bindingsFactory.createBindingsFor(customizer, domainType);
return predicateBuilder.getPredicate(domainType, parameters, bindings);