Copilot commented on code in PR #13397:
URL: https://github.com/apache/cloudstack/pull/13397#discussion_r3394129042
##########
engine/schema/src/main/java/com/cloud/network/dao/FirewallRulesDaoImpl.java:
##########
@@ -121,6 +122,18 @@ protected FirewallRulesDaoImpl() {
RoutingFirewallRulesSearch.done();
}
+ @PostConstruct
+ public void init() {
+ SearchBuilder<IPAddressVO> IpSearch = _ipDao.createSearchBuilder();
+ IpSearch.and("associatedWithVmId",
IpSearch.entity().getAssociatedWithVmId(), SearchCriteria.Op.EQ);
+ IpSearch.and("oneToOneNat", IpSearch.entity().isOneToOneNat(),
SearchCriteria.Op.NNULL);
+
+ VmSearch = createSearchBuilder();
+ VmSearch.and("purpose", VmSearch.entity().getPurpose(), Op.EQ);
+ VmSearch.join("ipSearch", IpSearch,
VmSearch.entity().getSourceIpAddressId(), IpSearch.entity().getId(),
JoinBuilder.JoinType.INNER);
+ VmSearch.done();
Review Comment:
Local variable `IpSearch` uses PascalCase, which is inconsistent with
typical Java local-variable naming and nearby patterns (e.g., `networkSearch`
in other DAOs). Renaming to `ipSearch` will make the initialization code easier
to read and consistent with the codebase.
--
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.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]