Issue #189 use maxRecords in GFEDao.getD2DDatabaseIdsFromDb
Former-commit-id: 26e79c68560dced9b7148e8eebf4a7394461bd7c
This commit is contained in:
parent
448dd1c35f
commit
5a1a6f2fdb
1 changed files with 6 additions and 4 deletions
|
@ -760,7 +760,8 @@ public class GFEDao extends DefaultPluginDao {
|
||||||
Pattern p = Pattern.compile("^" + abbreviation + "(\\d+)hr$");
|
Pattern p = Pattern.compile("^" + abbreviation + "(\\d+)hr$");
|
||||||
int lowestHr = -1;
|
int lowestHr = -1;
|
||||||
for (GridInfoRecord m : (List<GridInfoRecord>) results) {
|
for (GridInfoRecord m : (List<GridInfoRecord>) results) {
|
||||||
String param = m.getParameter().getAbbreviation().toLowerCase();
|
String param = m.getParameter().getAbbreviation()
|
||||||
|
.toLowerCase();
|
||||||
if (param.equals(abbreviation) && (lowestHr < 0)) {
|
if (param.equals(abbreviation) && (lowestHr < 0)) {
|
||||||
model = m;
|
model = m;
|
||||||
} else {
|
} else {
|
||||||
|
@ -867,7 +868,6 @@ public class GFEDao extends DefaultPluginDao {
|
||||||
return timeList;
|
return timeList;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
private List<DataTime> executeD2DParmQuery(ParmID id)
|
private List<DataTime> executeD2DParmQuery(ParmID id)
|
||||||
throws DataAccessLayerException {
|
throws DataAccessLayerException {
|
||||||
List<DataTime> times = new ArrayList<DataTime>();
|
List<DataTime> times = new ArrayList<DataTime>();
|
||||||
|
@ -913,7 +913,9 @@ public class GFEDao extends DefaultPluginDao {
|
||||||
query.addDistinctParameter("dataTime.refTime");
|
query.addDistinctParameter("dataTime.refTime");
|
||||||
query.addQueryParam(GridConstants.DATASET_ID, d2dModelName);
|
query.addQueryParam(GridConstants.DATASET_ID, d2dModelName);
|
||||||
query.addOrder("dataTime.refTime", false);
|
query.addOrder("dataTime.refTime", false);
|
||||||
|
if (maxRecords > 0) {
|
||||||
|
query.setMaxResults(maxRecords);
|
||||||
|
}
|
||||||
List<?> result = this.queryByCriteria(query);
|
List<?> result = this.queryByCriteria(query);
|
||||||
|
|
||||||
for (Object obj : result) {
|
for (Object obj : result) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue