Skip to content

Commit

Permalink
Revert "#11757: Fixed integrity-checker issue with empty results due …
Browse files Browse the repository at this point in the history
…to runs"

This reverts commit b558d70.
  • Loading branch information
agomez-dotcms committed Jun 1, 2017
1 parent b558d70 commit ef5fd75
Show file tree
Hide file tree
Showing 5 changed files with 5 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ public boolean generateIntegrityResults(final String endpointId) throws Exceptio

// Get data from results table
DotConnect dc = new DotConnect();
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName(), "where endpoint_id = '"+ endpointId+ "'") > 0;
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName()) > 0;
} catch (Exception e) {
throw new Exception("Error running the File Assets Integrity Check", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,7 @@ public boolean generateIntegrityResults(final String endpointId) throws Exceptio
checkPages(endpointId, IntegrityType.HTMLPAGES);

// Legacy HTML pages and contentlet pages share the same result table
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName(), "where endpoint_id = '"+ endpointId+ "'") > 0;
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName()) > 0;
} catch (Exception e) {
throw new Exception("Error running the HTML Pages Integrity Check", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -206,7 +206,7 @@ public boolean generateIntegrityResults(String endpointId) throws Exception {

}

return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName(), "where endpoint_id = '"+ endpointId+ "'") > 0;
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName()) > 0;
} catch (Exception e) {
throw new Exception("Error running the Folders Integrity Check", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -180,7 +180,7 @@ public boolean generateIntegrityResults(String endpointId) throws Exception {

}

return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName(), "where endpoint_id = '"+ endpointId+ "'") > 0;
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName()) > 0;
} catch (Exception e) {
throw new Exception("Error running the Roles Integrity Check", e);
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -929,11 +929,8 @@ public List<Map<String, Object>> getObjectResults(String dataSource)throws DotDa
* An error occurred when interacting with the database.
*/
public Long getRecordCount(String tableName) throws DotDataException {
return getRecordCount(tableName, "");
}
public Long getRecordCount(String tableName, String whereClause) throws DotDataException {
Long recordCount = 0L;
setSQL("SELECT COUNT(*) AS count FROM " + tableName +" "+ whereClause);
setSQL("SELECT COUNT(*) AS count FROM " + tableName);
if (DbConnectionFactory.isOracle()) {
BigDecimal result = (BigDecimal) loadObjectResults().get(0).get("count");
recordCount = new Long(result.toPlainString());
Expand Down

0 comments on commit ef5fd75

Please sign in to comment.