GutoVeronezi commented on code in PR #6510:
URL: https://github.com/apache/cloudstack/pull/6510#discussion_r908423517


##########
engine/schema/src/main/java/com/cloud/network/dao/NetworkDaoImpl.java:
##########
@@ -572,7 +572,7 @@ public List<NetworkVO> listByPhysicalNetwork(final long 
physicalNetworkId) {
     public List<NetworkVO> listByPhysicalNetworkTrafficType(final long 
physicalNetworkId, final TrafficType trafficType) {
         final SearchCriteria<NetworkVO> sc = AllFieldsSearch.create();
         sc.setParameters("trafficType", trafficType);
-        sc.setParameters("physicalNetworkId", physicalNetworkId);
+        sc.setParameters("physicalNetwork", physicalNetworkId);

Review Comment:
   @DaanHoogland, `SearchCriteria` works according the declaration of the field 
while creating the `SearchBuilder`. The field representing the physical network 
ID was declared as `physicalNetwork`: 
   
https://github.com/apache/cloudstack/blob/ea9124e49c6849828519402b9053557d0ff056a9/engine/schema/src/main/java/com/cloud/network/dao/NetworkDaoImpl.java#L122-L141
   
   Therefore, we need to use `physicalNetwork` in the `SearchCriteria` in order 
to add the validation to the where clause.



-- 
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]

Reply via email to