SGF-112 - Rejecting repository interfaces and methods using pagination.

Extended GemfireQueryMethod to reject methods that contain a Pageable parameter as we currently don't support pagination.
This commit is contained in:
Oliver Gierke
2012-08-06 15:01:04 +02:00
parent 045c3570ec
commit 0197bb70d5
3 changed files with 112 additions and 0 deletions

View File

@@ -18,6 +18,7 @@ package org.springframework.data.gemfire.repository.query;
import java.lang.reflect.Method;
import org.springframework.core.annotation.AnnotationUtils;
import org.springframework.data.domain.Pageable;
import org.springframework.data.gemfire.mapping.GemfirePersistentEntity;
import org.springframework.data.gemfire.mapping.GemfirePersistentProperty;
import org.springframework.data.gemfire.repository.Query;
@@ -51,6 +52,13 @@ public class GemfireQueryMethod extends QueryMethod {
Assert.notNull(context);
for (Class<?> type : method.getParameterTypes()) {
if (Pageable.class.isAssignableFrom(type)) {
throw new IllegalStateException("Pagination is not supported by Gemfire repositories! Offending method: "
+ method.toString());
}
}
this.method = method;
this.entity = context.getPersistentEntity(getDomainClass());
}