@@ -46,7 +46,6 @@ public class NicDaoImpl extends GenericDaoBase<NicVO, Long> implements NicDao {
4646 private SearchBuilder <NicVO > NonReleasedSearch ;
4747 private GenericSearchBuilder <NicVO , Integer > CountBy ;
4848 private GenericSearchBuilder <NicVO , Integer > CountByForStartingVms ;
49- private GenericSearchBuilder <NicVO , Integer > CountByForRunningVms ;
5049
5150 @ Inject
5251 VMInstanceDao _vmDao ;
@@ -96,17 +95,6 @@ protected void init() {
9695 join1 .and ("state" , join1 .entity ().getState (), Op .EQ );
9796 CountByForStartingVms .join ("vm" , join1 , CountByForStartingVms .entity ().getInstanceId (), join1 .entity ().getId (), JoinBuilder .JoinType .INNER );
9897 CountByForStartingVms .done ();
99-
100- CountByForRunningVms = createSearchBuilder (Integer .class );
101- CountByForRunningVms .select (null , Func .COUNT , CountByForRunningVms .entity ().getId ());
102- CountByForRunningVms .and ("networkId" , CountByForRunningVms .entity ().getNetworkId (), Op .EQ );
103- CountByForRunningVms .and ("removed" , CountByForRunningVms .entity ().getRemoved (), Op .NULL );
104- SearchBuilder <VMInstanceVO > join2 = _vmDao .createSearchBuilder ();
105- join2 .and ("state" , join2 .entity ().getState (), Op .EQ );
106- join2 .and ("type" , join2 .entity ().getType (), Op .EQ );
107- CountByForRunningVms .join ("vm" , join2 , CountByForRunningVms .entity ().getInstanceId (), join2 .entity ().getId (), JoinBuilder .JoinType .INNER );
108- CountByForRunningVms .done ();
109-
11098 }
11199
112100 @ Override
@@ -303,14 +291,4 @@ public int countNicsForStartingVms(long networkId) {
303291 List <Integer > results = customSearch (sc , null );
304292 return results .get (0 );
305293 }
306-
307- @ Override
308- public int countNicsForRunningVms (long networkId ) {
309- SearchCriteria <Integer > sc = CountByForRunningVms .create ();
310- sc .setParameters ("networkId" , networkId );
311- sc .setJoinParameters ("vm" , "state" , VirtualMachine .State .Running );
312- sc .setJoinParameters ("vm" , "type" , VirtualMachine .Type .User );
313- List <Integer > results = customSearch (sc , null );
314- return results .get (0 );
315- }
316294}
0 commit comments