sureshanaparti commented on a change in pull request #4374:
URL: https://github.com/apache/cloudstack/pull/4374#discussion_r500057043
##########
File path: framework/db/src/main/java/com/cloud/utils/db/GenericDaoBase.java
##########
@@ -1935,6 +1918,23 @@ public boolean configure(final String name, final
Map<String, Object> params) th
return builder.create();
}
+ private SearchCriteria<T> checkAndSetRemovedIsNull(SearchCriteria<T> sc) {
+ if (_removed != null) {
+ if (sc == null) {
+ sc = createSearchCriteria();
+ }
+ sc.addAnd(_removed.second().field.getName(),
SearchCriteria.Op.NULL);
+ }
+ return sc;
+ }
+
+ public Integer getDistinctCount(SearchCriteria<T> sc, boolean removed) {
+ if (!removed) {
Review comment:
`removed` & `_removed` seems to be redundant here & wherever used in
similar way, can you directly set / unset `_removed` as per its usage ? If the
purpose is to include / exclude removed records, you can use methods with
naming _*IncludingRemovedBy()_ [for ex: _getDistinctCountIncludingRemovedBy()_]
to be in sync with the other methods.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]