package com.zzh.dao.impl;

import com.zzh.dao.Pager;
import com.zzh.dao.entity.Entity;

public class DB2Pager extends Pager {

	@Override
	protected String getLimitString(Entity<?> entity) {
		// TODO implement it 
		return null;
	}

}

@@ -185,48 +185,744 @@
 ity)
- 
+%0A%09
 %7B%0A%09%09/
-/ TODO implement it %0A%09%09return null
+*%0A%09%09 * SELECT * FROM @tableName WHERE (@fieldName IN (SELECT @fieldName FROM%0A%09%09 * (SELECT @fieldName, rownumber() OVER(ORDER BY @fieldName ASC) AS rn%0A%09%09 * FROM @tableName) AS R WHERE R.rn BETWEEN @startNumber AND%0A%09%09 * @endNumber))%0A%09%09 */%0A%09%09String fieldName = entity.getIdentifiedField().getColumnName();%0A%09%09String tableName = entity.getViewName();%0A%09%09int startIndex = this.getPageSize() * (this.getPageNumber() - 1);%0A%09%09int endIndex = startIndex + this.getPageSize();%0A%09%09String ptn = %22%25%25s WHERE (%25s IN (SELECT %25s FROM (SELECT %25s,rownumber() OVER(ORDER BY %25s ASC) AS rn FROM %25s) AS R %22%0A%09%09%09%09+ %22WHERE R.rn BETWEEN %25d AND %25d))%22;%0A%0A%09%09return String.format(ptn, fieldName, fieldName, fieldName, fieldName, tableName,%0A%09%09%09%09startIndex, endIndex)
 ;%0A%09%7D

add DB2 pager SQL