QueryRequest.fetchAll 추가, AbstractController.setFetchSize 수정

master
mjkhan21 1 year ago
parent 64eb6d30db
commit 99ab158aa8

@ -14,6 +14,7 @@ public class QueryRequest extends ServiceRequest {
private String orderBy;
private int pageNum;
private int fetchSize;
private boolean fetchAll;
private String download;
/** .
@ -84,7 +85,7 @@ public class QueryRequest extends ServiceRequest {
* @return fetchSize
*/
public int getFetchSize() {
return isEmpty(download) ? fetchSize : 0;
return fetchSize;
}
/** .
@ -96,6 +97,27 @@ public class QueryRequest extends ServiceRequest {
return self();
}
/** .
* @return fetchAll
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public boolean fetchAll() {
return fetchAll;
}
/** .
* @param fetchAll
* <ul><li> true</li>
* <li> false</li>
* </ul>
*/
public <T extends QueryRequest> T setFetchAll(boolean fetchAll) {
this.fetchAll = fetchAll;
return self();
}
/** .
* @return download
* <ul><li> - "xls"</li>

@ -141,11 +141,27 @@ public abstract class AbstractController extends AbstractComponent {
.addObject(prefix + "Total", bounded.getTotalSize());
}
/** .<br />
* <ul><li>fetchAll true </li>
* <li>
* <ul><li>fetchSize 0 </li>
* <li> fetchSize(propertyService.properties.pageSize) </li>
* </ul>
* </li>
* </ul>
* @param <T> QueryRequest
* @param req
* @return
*/
protected <T extends QueryRequest> T setFetchSize(T req) {
if (req.getFetchSize() > 0
|| !isEmpty(req.getDownload())) return req;
return req.setFetchSize(properties.getInt("pageSize"));
if (req.fetchAll())
return req.setFetchSize(0);
else {
int fetchSize = req.getFetchSize();
if (fetchSize < 1)
req.setFetchSize(properties.getInt("pageSize"));
return req;
}
}
/**InputStream .

Loading…
Cancel
Save