summaryrefslogtreecommitdiffstats
path: root/ecomp-sdk/epsdk-analytics
diff options
context:
space:
mode:
Diffstat (limited to 'ecomp-sdk/epsdk-analytics')
-rw-r--r--ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java47
1 files changed, 2 insertions, 45 deletions
diff --git a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java
index 3091fa96..8d2cabcc 100644
--- a/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java
+++ b/ecomp-sdk/epsdk-analytics/src/main/java/org/onap/portalsdk/analytics/model/base/IdNameSql.java
@@ -132,8 +132,6 @@ public class IdNameSql extends IdNameList {
return "SELECT id, name FROM (" + sql + ") xid where id in [VALUE]";
}
-
- // public String getSqlNoOrderBy() { return sqlNoOrderBy; }
protected void setSql(String sql) {
this.sql = sql;
@@ -163,12 +161,6 @@ public class IdNameSql extends IdNameList {
removeAllElements();
} // clearData
-/* public void loadData(String pageNo, String searchString, String dbInfo, String userId) throws RaptorException {
- // setSql(searchString);
- loadUserData(pageNo, searchString, dbInfo,userId);
- } // loadData
-*/
-
public void loadUserData(String pageNo, String searchString, String dbInfo,String userId) throws RaptorException {
int iPageNo = 0;
@@ -196,11 +188,6 @@ public class IdNameSql extends IdNameList {
}
public void loadData(String searchString, int pageNo, String dbInfo) throws RaptorException {
-
- //boolean dataAlreadyLoaded = (this.pageNo == pageNo);
-
- //if (dataAlreadyLoaded)
- // return;
this.pageNo = pageNo;
@@ -251,7 +238,7 @@ public class IdNameSql extends IdNameList {
query.append(" LIMIT " + ((dataSize < 0) ? (endRow + 1) : endRow));
} else if(pageNo!=2 && (dbType.equals(AppConstants.MYSQL))) {
- query.append(" LIMIT " + startRow); //((dataSize < 0) ? (endRow + 1) : endRow)
+ query.append(" LIMIT " + startRow);
}
if(searchString!=null && searchString.length()>0 && !searchString.equals("%")) {
@@ -272,12 +259,6 @@ public class IdNameSql extends IdNameList {
boolean readOnly = true;
ds = ConnectionUtils.getDataSet(query.toString(), dbInfo);
- // if ( (dbInfo!=null) && (!dbInfo.equals(AppConstants.DB_LOCAL))) {
- // Globals.getRDbUtils().setDBPrefix(dbInfo);
- // ds = RemDbUtils.executeQuery(query);
- // }
- // else
- // ds = DbUtils.executeQuery(query);
clearData();
if (dbType.equals("DAYTONA") && (getDefaultSQL()!=null && getDefaultSQL().trim().toUpperCase().startsWith("SELECT"))) {
defaultQuery = getDefaultSQL();
@@ -292,18 +273,15 @@ public class IdNameSql extends IdNameList {
dsDefault = ConnectionUtils.getDataSet(defaultQuery, dbInfo);
if(dsDefault!=null && dsDefault.getRowCount()>0) {
for (int i = 0; i < dsDefault.getRowCount(); i++) {
- //addValue(dsDefault.getString(i, 0), dsDefault.getString(i, 1), true);
defaultMap.put(dsDefault.getString(i, "id"), dsDefault.getString(i, "name"));
}
}
}
for (int i = 0; i < ((pageNo!=-2)?Math.min(ds.getRowCount(), pageSize):ds.getRowCount()); i++) {
- //if(getCount()==0)
- // addValue(ds.getString(i, 0), ds.getString(i, 1));
if(i==0 && avail_ReadOnly)
readOnly = ds.getString(i, "ff_readonly").toUpperCase().startsWith("Y")||ds.getString(i, "ff_readonly").toUpperCase().startsWith("T");
- if(getCount()>=0) {//&& !((IdNameValue)getValue(0)).getId().equals(ds.getString(i, 0)))
+ if(getCount()>=0) {
if(defaultMap.get(ds.getString(i, "id")) == null)
if(avail_ReadOnly)
addValue(ds.getString(i, "id"), ds.getString(i, "name"), false, readOnly);
@@ -324,7 +302,6 @@ public class IdNameSql extends IdNameList {
else
dataSize = ds.getRowCount();
- //System.out.println("IDNAME SQL COUNT");*/
if(searchString!=null && searchString.length()>0 && !searchString.equals("%")) {
queryPop = new StringBuffer("");
queryPop.append("SELECT count(*) num_rows FROM ("+ Globals.getReportSqlForFormfield() +", name FROM (" + sql
@@ -340,21 +317,11 @@ public class IdNameSql extends IdNameList {
}
} else if(dataSizeUsedInPopup == -3) {
queryPop = new StringBuffer("");
- //System.out.println("IDNAME SQL COUNT");
- //queryPop.append("SELECT count(*) num_rows FROM ("+query.toString()+") x");
queryPop.append("SELECT count(*) num_rows FROM ("+ Globals.getReportSqlForFormfield() +", name FROM (" + sql
+ ") x ");
queryPop.append(") xx ");
ds = ConnectionUtils.getDataSet(queryPop.toString(), dbInfo);
- // if ( (dbInfo!=null) &&
- // (!dbInfo.equals(AppConstants.DB_LOCAL))) {
- // Globals.getRDbUtils().setDBPrefix(dbInfo);
- // ds = RemDbUtils.executeQuery(query);
- // }
- // else
- // ds = DbUtils.executeQuery(query);
- //
try {
dataSizeUsedInPopup = Integer.parseInt(ds.getString(0, 0));
} catch (NumberFormatException e) {
@@ -366,21 +333,11 @@ public class IdNameSql extends IdNameList {
//pageNo = 0;
if(pageNo!= -2) {
queryPop = new StringBuffer("");
- //System.out.println("IDNAME SQL COUNT");
- //queryPop.append("SELECT count(*) num_rows FROM ("+query.toString()+") x");
queryPop.append("SELECT count(*) num_rows FROM ("+ Globals.getReportSqlForFormfield() +" FROM (" + sql
+ ") x ");
queryPop.append(") xx ");
ds = ConnectionUtils.getDataSet(queryPop.toString(), dbInfo);
- // if ( (dbInfo!=null) &&
- // (!dbInfo.equals(AppConstants.DB_LOCAL))) {
- // Globals.getRDbUtils().setDBPrefix(dbInfo);
- // ds = RemDbUtils.executeQuery(query);
- // }
- // else
- // ds = DbUtils.executeQuery(query);
- //
try {
dataSize = Integer.parseInt(ds.getString(0, 0));
dataSizeUsedInPopup = Integer.parseInt(ds.getString(0, 0));