Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

#11757: Fixed integrity-checker issue with empty results due to runs #11803

Merged
merged 1 commit into from
Jun 1, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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()) > 0;
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName(), "where endpoint_id = '"+ endpointId+ "'") > 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()) > 0;
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName(), "where endpoint_id = '"+ endpointId+ "'") > 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()) > 0;
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName(), "where endpoint_id = '"+ endpointId+ "'") > 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()) > 0;
return (Long) dc.getRecordCount(getIntegrityType().getResultsTableName(), "where endpoint_id = '"+ endpointId+ "'") > 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 @@ -928,9 +928,12 @@ public List<Map<String, Object>> getObjectResults(String dataSource)throws DotDa
* @throws DotDataException
* An error occurred when interacting with the database.
*/
public Long getRecordCount(String tableName) throws DotDataException {
Long recordCount = 0L;
setSQL("SELECT COUNT(*) AS count FROM " + tableName);
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);
if (DbConnectionFactory.isOracle()) {
BigDecimal result = (BigDecimal) loadObjectResults().get(0).get("count");
recordCount = new Long(result.toPlainString());
Expand Down