diff --git a/src/main/java/org/nebula/contrib/ngbatis/io/MapperResourceLoader.java b/src/main/java/org/nebula/contrib/ngbatis/io/MapperResourceLoader.java index 77fd835..1a738da 100644 --- a/src/main/java/org/nebula/contrib/ngbatis/io/MapperResourceLoader.java +++ b/src/main/java/org/nebula/contrib/ngbatis/io/MapperResourceLoader.java @@ -315,7 +315,6 @@ private MethodModel createPageMethod(MethodModel methodModel, List metho MethodModel pageMethodModel = new MethodModel(); Annotation[][] parameterAnnotations = setParamAnnotations(parameterTypes, namespace, methodName, pageMethodModel); - String pageParamName = getPageParamName(parameterAnnotations, pageParamIndex); pageMethodModel.setParameterTypes(parameterTypes); pageMethodModel.setId(pageMethodName); @@ -324,6 +323,7 @@ private MethodModel createPageMethod(MethodModel methodModel, List metho pageMethodModel.setSpace(methodModel.getSpace()); String cql = methodModel.getText(); + String pageParamName = getPageParamName(parameterAnnotations, pageParamIndex); if (pageParamName != null) { String format = "%s\t\tSKIP $%s.startRow LIMIT $%s.pageSize"; cql = String.format(format, cql, pageParamName, pageParamName);