package com.zzh.dao.impl;

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

public class SQLServerPager extends Pager {

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

}

@@ -79,16 +79,55 @@
 .Entity;
+%0Aimport com.zzh.dao.entity.EntityField;
 %0A%0Apublic
@@ -230,47 +230,772 @@
 ity)
- %7B%0A%09%09// TODO implement it%0A%09%09return null
+%0A%09%7B%0A%09%09return %22%25s%22;%0A%09%7D%0A%0A%09@Override%0A%09public String getResultSetName(Entity%3C?%3E entity)%0A%09%7B%0A%09%09/*%0A%09%09 * SELECT TOP @pageSize FROM @tableName WHERE @fieldName NOT IN (SELECT%0A%09%09 * TOP @pageSize(@page-1) @fieldName FROM @tableName ORDER BY @fieldName%0A%09%09 * ASC ) ORDER BY @fieldName ASC%0A%09%09 */%0A%09%09EntityField field = entity.getIdentifiedField();%0A%09%09String viewName = entity.getViewName();%0A%09%09String fieldName = field.getField().getName();%0A%09%09int pageSize = this.getPageSize();%0A%09%09int offSet = pageSize * (this.getPageNumber() - 1);%0A%0A%09%09String querySQL = %22(SELECT TOP %25d * FROM %25s WHERE %25s NOT IN (SELECT TOP %25d %25s FROM %25s ORDER BY %25s ASC) ORDER BY %25s ASC) AS R%22;%0A%0A%09%09return String.format(querySQL, pageSize, viewName, fieldName, offSet, fieldName, viewName,%0A%09%09%09%09fieldName, fieldName)
 ;%0A%09%7D

add MS SQL Server Pager clause