@@ -127,37 +127,21 @@ public class QPageRequest extends AbstractPageRequest {
|
||||
return QPageRequest.of(0, pageSize);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.Pageable#getSort()
|
||||
*/
|
||||
@Override
|
||||
public Sort getSort() {
|
||||
return sort;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.AbstractPageRequest#next()
|
||||
*/
|
||||
@Override
|
||||
public Pageable next() {
|
||||
return QPageRequest.of(getPageNumber() + 1, getPageSize(), sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.AbstractPageRequest#previous()
|
||||
*/
|
||||
@Override
|
||||
public Pageable previous() {
|
||||
return QPageRequest.of(getPageNumber() - 1, getPageSize(), sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.domain.AbstractPageRequest#first()
|
||||
*/
|
||||
@Override
|
||||
public Pageable first() {
|
||||
return QPageRequest.of(0, getPageSize(), sort);
|
||||
|
||||
@@ -57,92 +57,52 @@ public class QuerydslRepositoryInvokerAdapter implements RepositoryInvoker {
|
||||
this.predicate = predicate;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokePagedFindAll(org.springframework.data.domain.Pageable)
|
||||
*/
|
||||
@Override
|
||||
public Iterable<Object> invokeFindAll(Pageable pageable) {
|
||||
return executor.findAll(predicate, pageable);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeSortedFindAll(org.springframework.data.domain.Sort)
|
||||
*/
|
||||
@Override
|
||||
public Iterable<Object> invokeFindAll(Sort sort) {
|
||||
return executor.findAll(predicate, sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasDeleteMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasDeleteMethod() {
|
||||
return delegate.hasDeleteMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasFindAllMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasFindAllMethod() {
|
||||
return delegate.hasFindAllMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasFindOneMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasFindOneMethod() {
|
||||
return delegate.hasFindOneMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvocationInformation#hasSaveMethod()
|
||||
*/
|
||||
@Override
|
||||
public boolean hasSaveMethod() {
|
||||
return delegate.hasSaveMethod();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeDeleteById(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public void invokeDeleteById(Object id) {
|
||||
delegate.invokeDeleteById(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeFindById(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> Optional<T> invokeFindById(Object id) {
|
||||
return delegate.invokeFindById(id);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeQueryMethod(java.lang.reflect.Method, org.springframework.util.MultiValueMap, org.springframework.data.domain.Pageable, org.springframework.data.domain.Sort)
|
||||
*/
|
||||
@Override
|
||||
public Optional<Object> invokeQueryMethod(Method method, MultiValueMap<String, ? extends Object> parameters,
|
||||
Pageable pageable, Sort sort) {
|
||||
return delegate.invokeQueryMethod(method, parameters, pageable, sort);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.repository.support.RepositoryInvoker#invokeSave(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public <T> T invokeSave(T object) {
|
||||
return delegate.invokeSave(object);
|
||||
|
||||
@@ -64,65 +64,37 @@ record PropertyPathInformation(PropertyPath path) implements PathInformation {
|
||||
return new PropertyPathInformation(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getRootParentType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getRootParentType() {
|
||||
return path.getOwningType().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getLeafType() {
|
||||
return path.getLeafProperty().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafParentType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getLeafParentType() {
|
||||
return path.getLeafProperty().getOwningType().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafProperty()
|
||||
*/
|
||||
@Override
|
||||
public String getLeafProperty() {
|
||||
return path.getLeafProperty().getSegment();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafPropertyDescriptor()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public PropertyDescriptor getLeafPropertyDescriptor() {
|
||||
return BeanUtils.getPropertyDescriptor(getLeafParentType(), getLeafProperty());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#toDotPath()
|
||||
*/
|
||||
@Override
|
||||
public String toDotPath() {
|
||||
return path.toDotPath();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#reifyPath(org.springframework.data.querydsl.EntityPathResolver)
|
||||
*/
|
||||
@Override
|
||||
public Path<?> reifyPath(EntityPathResolver resolver) {
|
||||
return reifyPath(resolver, path, null);
|
||||
@@ -147,10 +119,6 @@ record PropertyPathInformation(PropertyPath path) implements PathInformation {
|
||||
return (Path<?>) value;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -166,10 +134,6 @@ record PropertyPathInformation(PropertyPath path) implements PathInformation {
|
||||
&& ObjectUtils.nullSafeEquals(toDotPath(), that.toDotPath());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(getRootParentType());
|
||||
@@ -177,10 +141,6 @@ record PropertyPathInformation(PropertyPath path) implements PathInformation {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "PropertyPathInformation(path=" + this.path + ")";
|
||||
|
||||
@@ -476,10 +476,6 @@ public class QuerydslBindings {
|
||||
registerBinding(PathAndBinding.withPath(path));
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.QuerydslBindings.PathBinder#registerBinding(org.springframework.data.querydsl.binding.QuerydslBindings.PathAndBinding)
|
||||
*/
|
||||
@Override
|
||||
protected void registerBinding(PathAndBinding<P, T> binding) {
|
||||
|
||||
@@ -575,10 +571,6 @@ public class QuerydslBindings {
|
||||
return this.binding;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
if (this == o) {
|
||||
@@ -593,10 +585,6 @@ public class QuerydslBindings {
|
||||
return ObjectUtils.nullSafeEquals(binding, that.binding);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(path);
|
||||
@@ -604,10 +592,6 @@ public class QuerydslBindings {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QuerydslBindings.PathAndBinding(path=" + this.getPath() + ", binding=" + this.getBinding() + ")";
|
||||
|
||||
@@ -68,10 +68,6 @@ public class QuerydslBindingsFactory implements ApplicationContextAware {
|
||||
this.defaultCustomizer = NoOpCustomizer.INSTANCE;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.context.ApplicationContextAware#setApplicationContext(org.springframework.context.ApplicationContext)
|
||||
*/
|
||||
@Override
|
||||
public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
|
||||
|
||||
|
||||
@@ -42,10 +42,6 @@ import com.querydsl.core.types.dsl.SimpleExpression;
|
||||
*/
|
||||
class QuerydslDefaultBinding implements MultiValueBinding<Path<? extends Object>, Object> {
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.web.querydsl.QueryDslPredicateBuilder#buildPredicate(org.springframework.data.mapping.PropertyPath, java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
@SuppressWarnings({ "unchecked", "rawtypes" })
|
||||
public Optional<Predicate> bind(Path<?> path, Collection<? extends Object> value) {
|
||||
|
||||
@@ -44,28 +44,16 @@ class QuerydslPathInformation implements PathInformation {
|
||||
return new QuerydslPathInformation(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getRootParentType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getRootParentType() {
|
||||
return path.getRoot().getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getLeafType() {
|
||||
return path.getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafParentType()
|
||||
*/
|
||||
@Override
|
||||
public Class<?> getLeafParentType() {
|
||||
|
||||
@@ -78,46 +66,26 @@ class QuerydslPathInformation implements PathInformation {
|
||||
return parent.getType();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafProperty()
|
||||
*/
|
||||
@Override
|
||||
public String getLeafProperty() {
|
||||
return path.getMetadata().getElement().toString();
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#getLeafPropertyDescriptor()
|
||||
*/
|
||||
@Nullable
|
||||
@Override
|
||||
public PropertyDescriptor getLeafPropertyDescriptor() {
|
||||
return BeanUtils.getPropertyDescriptor(getLeafParentType(), getLeafProperty());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#toDotPath()
|
||||
*/
|
||||
@Override
|
||||
public String toDotPath() {
|
||||
return QuerydslUtils.toDotPath(path);
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see org.springframework.data.querydsl.binding.PathInformation#reifyPath(org.springframework.data.querydsl.EntityPathResolver)
|
||||
*/
|
||||
public Path<?> reifyPath(EntityPathResolver resolver) {
|
||||
return path;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#equals(java.lang.Object)
|
||||
*/
|
||||
@Override
|
||||
public boolean equals(Object o) {
|
||||
|
||||
@@ -133,10 +101,6 @@ class QuerydslPathInformation implements PathInformation {
|
||||
&& ObjectUtils.nullSafeEquals(toDotPath(), that.toDotPath());
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#hashCode()
|
||||
*/
|
||||
@Override
|
||||
public int hashCode() {
|
||||
var result = ObjectUtils.nullSafeHashCode(getRootParentType());
|
||||
@@ -144,10 +108,6 @@ class QuerydslPathInformation implements PathInformation {
|
||||
return result;
|
||||
}
|
||||
|
||||
/*
|
||||
* (non-Javadoc)
|
||||
* @see java.lang.Object#toString()
|
||||
*/
|
||||
@Override
|
||||
public String toString() {
|
||||
return "QuerydslPathInformation(path=" + this.path + ")";
|
||||
|
||||
Reference in New Issue
Block a user