|
|
@ -1,14 +1,15 @@
|
|
|
|
package kr.xit.framework.support.mybatis;
|
|
|
|
package kr.xit.framework.support.mybatis;
|
|
|
|
|
|
|
|
|
|
|
|
import kr.xit.framework.support.mybatis.paging.domain.Order;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.mybatis.paging.domain.PageBounds;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.util.Checks;
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.RowBounds;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
import java.lang.reflect.InvocationTargetException;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.lang.reflect.Method;
|
|
|
|
import java.util.Map;
|
|
|
|
import java.util.Map;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import org.apache.ibatis.session.RowBounds;
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
import kr.xit.framework.support.mybatis.paging.domain.Order;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.mybatis.paging.domain.PageBounds;
|
|
|
|
|
|
|
|
import kr.xit.framework.support.util.Checks;
|
|
|
|
|
|
|
|
|
|
|
|
public class MybatisUtils{
|
|
|
|
public class MybatisUtils{
|
|
|
|
public static <T> RowBounds getPagingInfo(Map<String,Object> map){
|
|
|
|
public static <T> RowBounds getPagingInfo(Map<String,Object> map){
|
|
|
|
if(Checks.isEmpty(map)){
|
|
|
|
if(Checks.isEmpty(map)){
|
|
|
@ -30,10 +31,10 @@ public class MybatisUtils{
|
|
|
|
}
|
|
|
|
}
|
|
|
|
try {
|
|
|
|
try {
|
|
|
|
Method pageMethod = cls.getClass().getMethod("getPage");
|
|
|
|
Method pageMethod = cls.getClass().getMethod("getPage");
|
|
|
|
page = (Integer)pageMethod.invoke(cls, null);
|
|
|
|
if(!Checks.isEmpty(pageMethod)) page = (Integer)pageMethod.invoke(cls, null);
|
|
|
|
|
|
|
|
|
|
|
|
Method limitMethod = cls.getClass().getMethod("getPerPage");
|
|
|
|
Method limitMethod = cls.getClass().getMethod("getPerPage");
|
|
|
|
limit = (Integer)limitMethod.invoke(cls, null);
|
|
|
|
if(!Checks.isEmpty(limitMethod)) limit = (Integer)limitMethod.invoke(cls, null);
|
|
|
|
} catch (IllegalAccessException ex) {
|
|
|
|
} catch (IllegalAccessException ex) {
|
|
|
|
throw new RuntimeException(ex);
|
|
|
|
throw new RuntimeException(ex);
|
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
|
} catch (NoSuchMethodException e) {
|
|
|
|