test_class.file: model/src/test/java/com/abiquo/server/core/cloud/VirtualMachineDAOTest.java
test_class.identifier: VirtualMachineDAOTest
test_class.superclass: extends DefaultDAOTestBase<VirtualMachineDAO, VirtualMachine>
test_case.body: @Test
      public void findVirtualMachinesNotAllocatedCompatibleHypervisor()
      {
          VirtualMachine vm = eg().createUniqueInstance();
          // used for posterior search
          Hypervisor hyp = vm.getHypervisor();
          vm.setHypervisor(null);
  
          vm.setState(VirtualMachineState.NOT_ALLOCATED);
          List<Object> vmlist = new ArrayList<Object>();
          eg().addAuxiliaryEntitiesToPersist(vm, vmlist);
          vmlist.add(vm);
  
          ds().persistAll(vmlist.toArray());
  
          VirtualMachineDAO dao = createDaoForRollbackTransaction();
          List<VirtualMachine> vms = dao.findVirtualMachinesNotAllocatedCompatibleHypervisor(hyp);
          assertEquals(vms.size(), 1);
      }
test_case.class_method_signature: VirtualMachineDAOTest.findVirtualMachinesNotAllocatedCompatibleHypervisor()
test_case.full_signature: @Test public void findVirtualMachinesNotAllocatedCompatibleHypervisor()
test_case.identifier: findVirtualMachinesNotAllocatedCompatibleHypervisor
test_case.invocations: createUniqueInstance eg getHypervisor setHypervisor setState addAuxiliaryEntitiesToPersist eg add persistAll ds toArray createDaoForRollbackTransaction findVirtualMachinesNotAllocatedCompatibleHypervisor assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void findVirtualMachinesNotAllocatedCompatibleHypervisor()
focal_class.declarator: BY_VAPP_AND_ID =
          "SELECT nvi.virtualMachine " + "FROM NodeVirtualImage nvi "
              + "WHERE nvi.virtualAppliance.id = :vapp_id AND nvi.virtualMachine.id = :vm_id"
focal_class.modifier: public static final
focal_class.original_string: public static final String BY_VAPP_AND_ID =
          "SELECT nvi.virtualMachine " + "FROM NodeVirtualImage nvi "
              + "WHERE nvi.virtualAppliance.id = :vapp_id AND nvi.virtualMachine.id = :vm_id";
focal_class.type: String
focal_class.var_name: BY_VAPP_AND_ID
focal_class.file: model/src/main/java/com/abiquo/server/core/cloud/VirtualMachineDAO.java
focal_class.identifier: VirtualMachineDAO
focal_class.class_method_signature: VirtualMachineDAO.equalName(final String name)
focal_class.full_signature: private static Criterion equalName(final String name)
focal_class.identifier: equalName
focal_class.modifiers: private static
focal_class.parameters: (final String name)
focal_class.return: Criterion
focal_class.signature: Criterion equalName(final String name)
focal_class.class_method_signature: VirtualMachineDAO.sameEnterprise(final Enterprise enterprise)
focal_class.full_signature: private static Criterion sameEnterprise(final Enterprise enterprise)
focal_class.identifier: sameEnterprise
focal_class.modifiers: private static
focal_class.parameters: (final Enterprise enterprise)
focal_class.return: Criterion
focal_class.signature: Criterion sameEnterprise(final Enterprise enterprise)
focal_class.class_method_signature: VirtualMachineDAO.sameHypervisor(final Hypervisor hypervisor)
focal_class.full_signature: private static Criterion sameHypervisor(final Hypervisor hypervisor)
focal_class.identifier: sameHypervisor
focal_class.modifiers: private static
focal_class.parameters: (final Hypervisor hypervisor)
focal_class.return: Criterion
focal_class.signature: Criterion sameHypervisor(final Hypervisor hypervisor)
focal_class.class_method_signature: VirtualMachineDAO.sameUser(final User user)
focal_class.full_signature: private static Criterion sameUser(final User user)
focal_class.identifier: sameUser
focal_class.modifiers: private static
focal_class.parameters: (final User user)
focal_class.return: Criterion
focal_class.signature: Criterion sameUser(final User user)
focal_class.class_method_signature: VirtualMachineDAO.VirtualMachineDAO()
focal_class.full_signature: public  VirtualMachineDAO()
focal_class.identifier: VirtualMachineDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  VirtualMachineDAO()
focal_class.class_method_signature: VirtualMachineDAO.VirtualMachineDAO(final EntityManager entityManager)
focal_class.full_signature: public  VirtualMachineDAO(final EntityManager entityManager)
focal_class.identifier: VirtualMachineDAO
focal_class.modifiers: public
focal_class.parameters: (final EntityManager entityManager)
focal_class.signature:  VirtualMachineDAO(final EntityManager entityManager)
focal_class.class_method_signature: VirtualMachineDAO.getNotManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.full_signature: public List<VirtualMachine> getNotManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.identifier: getNotManagedVirtualMachines
focal_class.modifiers: public
focal_class.parameters: (final Hypervisor hypervisor)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> getNotManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.class_method_signature: VirtualMachineDAO.existsAnyWithName(final String name)
focal_class.full_signature: public boolean existsAnyWithName(final String name)
focal_class.identifier: existsAnyWithName
focal_class.modifiers: public
focal_class.parameters: (final String name)
focal_class.return: boolean
focal_class.signature: boolean existsAnyWithName(final String name)
focal_class.class_method_signature: VirtualMachineDAO.findByIdByVirtualApp(final VirtualAppliance vapp, final Integer vmId)
focal_class.full_signature: public VirtualMachine findByIdByVirtualApp(final VirtualAppliance vapp, final Integer vmId)
focal_class.identifier: findByIdByVirtualApp
focal_class.modifiers: public
focal_class.parameters: (final VirtualAppliance vapp, final Integer vmId)
focal_class.return: VirtualMachine
focal_class.signature: VirtualMachine findByIdByVirtualApp(final VirtualAppliance vapp, final Integer vmId)
focal_class.class_method_signature: VirtualMachineDAO.findByName(final String name)
focal_class.full_signature: public VirtualMachine findByName(final String name)
focal_class.identifier: findByName
focal_class.modifiers: public
focal_class.parameters: (final String name)
focal_class.return: VirtualMachine
focal_class.signature: VirtualMachine findByName(final String name)
focal_class.class_method_signature: VirtualMachineDAO.findByUUID(final String uuid)
focal_class.full_signature: public VirtualMachine findByUUID(final String uuid)
focal_class.identifier: findByUUID
focal_class.modifiers: public
focal_class.parameters: (final String uuid)
focal_class.return: VirtualMachine
focal_class.signature: VirtualMachine findByUUID(final String uuid)
focal_class.class_method_signature: VirtualMachineDAO.findManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.full_signature: public List<VirtualMachine> findManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.identifier: findManagedVirtualMachines
focal_class.modifiers: public
focal_class.parameters: (final Hypervisor hypervisor)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> findManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.class_method_signature: VirtualMachineDAO.findVirtualMachineByHypervisor(final Hypervisor hypervisor,
          final Integer virtualMachineId)
focal_class.full_signature: public VirtualMachine findVirtualMachineByHypervisor(final Hypervisor hypervisor,
          final Integer virtualMachineId)
focal_class.identifier: findVirtualMachineByHypervisor
focal_class.modifiers: public
focal_class.parameters: (final Hypervisor hypervisor,
          final Integer virtualMachineId)
focal_class.return: VirtualMachine
focal_class.signature: VirtualMachine findVirtualMachineByHypervisor(final Hypervisor hypervisor,
          final Integer virtualMachineId)
focal_class.class_method_signature: VirtualMachineDAO.findVirtualMachines(final Hypervisor hypervisor)
focal_class.full_signature: public List<VirtualMachine> findVirtualMachines(final Hypervisor hypervisor)
focal_class.identifier: findVirtualMachines
focal_class.modifiers: public
focal_class.parameters: (final Hypervisor hypervisor)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> findVirtualMachines(final Hypervisor hypervisor)
focal_class.class_method_signature: VirtualMachineDAO.findVirtualMachinesNotAllocatedCompatibleHypervisor(
          final Hypervisor hypervisor)
focal_class.full_signature: public List<VirtualMachine> findVirtualMachinesNotAllocatedCompatibleHypervisor(
          final Hypervisor hypervisor)
focal_class.identifier: findVirtualMachinesNotAllocatedCompatibleHypervisor
focal_class.modifiers: public
focal_class.parameters: (
          final Hypervisor hypervisor)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> findVirtualMachinesNotAllocatedCompatibleHypervisor(
          final Hypervisor hypervisor)
focal_class.class_method_signature: VirtualMachineDAO.findVirtualMachinesByDatacenter(final Integer datacenterId)
focal_class.full_signature: public List<VirtualMachine> findVirtualMachinesByDatacenter(final Integer datacenterId)
focal_class.identifier: findVirtualMachinesByDatacenter
focal_class.modifiers: public
focal_class.parameters: (final Integer datacenterId)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> findVirtualMachinesByDatacenter(final Integer datacenterId)
focal_class.class_method_signature: VirtualMachineDAO.findVirtualMachinesByEnterprise(final Enterprise enterprise)
focal_class.full_signature: public List<VirtualMachine> findVirtualMachinesByEnterprise(final Enterprise enterprise)
focal_class.identifier: findVirtualMachinesByEnterprise
focal_class.modifiers: public
focal_class.parameters: (final Enterprise enterprise)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> findVirtualMachinesByEnterprise(final Enterprise enterprise)
focal_class.class_method_signature: VirtualMachineDAO.findVirtualMachinesByUser(final Enterprise enterprise,
          final User user)
focal_class.full_signature: public List<VirtualMachine> findVirtualMachinesByUser(final Enterprise enterprise,
          final User user)
focal_class.identifier: findVirtualMachinesByUser
focal_class.modifiers: public
focal_class.parameters: (final Enterprise enterprise,
          final User user)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> findVirtualMachinesByUser(final Enterprise enterprise,
          final User user)
focal_class.class_method_signature: VirtualMachineDAO.findVirtualMachinesByVirtualAppliance(final Integer vappId,
          Integer startwith, Integer limit, final String filter, final OrderByEnum orderby,
          final boolean asc)
focal_class.full_signature: public List<VirtualMachine> findVirtualMachinesByVirtualAppliance(final Integer vappId,
          Integer startwith, Integer limit, final String filter, final OrderByEnum orderby,
          final boolean asc)
focal_class.identifier: findVirtualMachinesByVirtualAppliance
focal_class.modifiers: public
focal_class.parameters: (final Integer vappId,
          Integer startwith, Integer limit, final String filter, final OrderByEnum orderby,
          final boolean asc)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> findVirtualMachinesByVirtualAppliance(final Integer vappId,
          Integer startwith, Integer limit, final String filter, final OrderByEnum orderby,
          final boolean asc)
focal_class.class_method_signature: VirtualMachineDAO.findByVirtualMachineTemplate(final Integer virtualMachineTemplateId)
focal_class.full_signature: public List<VirtualMachine> findByVirtualMachineTemplate(final Integer virtualMachineTemplateId)
focal_class.identifier: findByVirtualMachineTemplate
focal_class.modifiers: public
focal_class.parameters: (final Integer virtualMachineTemplateId)
focal_class.return: List<VirtualMachine>
focal_class.signature: List<VirtualMachine> findByVirtualMachineTemplate(final Integer virtualMachineTemplateId)
focal_class.class_method_signature: VirtualMachineDAO.hasVirtualMachineTemplate(final Integer virtualMachineTemplateId)
focal_class.full_signature: public boolean hasVirtualMachineTemplate(final Integer virtualMachineTemplateId)
focal_class.identifier: hasVirtualMachineTemplate
focal_class.modifiers: public
focal_class.parameters: (final Integer virtualMachineTemplateId)
focal_class.return: boolean
focal_class.signature: boolean hasVirtualMachineTemplate(final Integer virtualMachineTemplateId)
focal_class.class_method_signature: VirtualMachineDAO.updateVirtualMachineState(final Integer vmachineId, final VirtualMachineState state)
focal_class.full_signature: public void updateVirtualMachineState(final Integer vmachineId, final VirtualMachineState state)
focal_class.identifier: updateVirtualMachineState
focal_class.modifiers: public
focal_class.parameters: (final Integer vmachineId, final VirtualMachineState state)
focal_class.return: void
focal_class.signature: void updateVirtualMachineState(final Integer vmachineId, final VirtualMachineState state)
focal_class.class_method_signature: VirtualMachineDAO.unknownState(final Integer vmachineId)
focal_class.full_signature: public void unknownState(final Integer vmachineId)
focal_class.identifier: unknownState
focal_class.modifiers: public
focal_class.parameters: (final Integer vmachineId)
focal_class.return: void
focal_class.signature: void unknownState(final Integer vmachineId)
focal_class.class_method_signature: VirtualMachineDAO.managed()
focal_class.full_signature: private Criterion managed()
focal_class.identifier: managed
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Criterion
focal_class.signature: Criterion managed()
focal_class.class_method_signature: VirtualMachineDAO.notManaged()
focal_class.full_signature: private Criterion notManaged()
focal_class.identifier: notManaged
focal_class.modifiers: private
focal_class.parameters: ()
focal_class.return: Criterion
focal_class.signature: Criterion notManaged()
focal_class.class_method_signature: VirtualMachineDAO.temporalVirtualMachine(final Integer vmachineId)
focal_class.full_signature: private Criteria temporalVirtualMachine(final Integer vmachineId)
focal_class.identifier: temporalVirtualMachine
focal_class.modifiers: private
focal_class.parameters: (final Integer vmachineId)
focal_class.return: Criteria
focal_class.signature: Criteria temporalVirtualMachine(final Integer vmachineId)
focal_class.class_method_signature: VirtualMachineDAO.findBackup(final VirtualMachine vmachine)
focal_class.full_signature: public VirtualMachine findBackup(final VirtualMachine vmachine)
focal_class.identifier: findBackup
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine vmachine)
focal_class.return: VirtualMachine
focal_class.signature: VirtualMachine findBackup(final VirtualMachine vmachine)
focal_class.class_method_signature: VirtualMachineDAO.refreshLock(final VirtualMachine vm)
focal_class.full_signature: public void refreshLock(final VirtualMachine vm)
focal_class.identifier: refreshLock
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine vm)
focal_class.return: void
focal_class.signature: void refreshLock(final VirtualMachine vm)
focal_class.class_method_signature: VirtualMachineDAO.refresh(final VirtualMachine vm)
focal_class.full_signature: public void refresh(final VirtualMachine vm)
focal_class.identifier: refresh
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine vm)
focal_class.return: void
focal_class.signature: void refresh(final VirtualMachine vm)
focal_class.class_method_signature: VirtualMachineDAO.detachHypervisor(final VirtualMachine vm)
focal_class.full_signature: public void detachHypervisor(final VirtualMachine vm)
focal_class.identifier: detachHypervisor
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine vm)
focal_class.return: void
focal_class.signature: void detachHypervisor(final VirtualMachine vm)
focal_class.class_method_signature: VirtualMachineDAO.detachVirtualMachine(final VirtualMachine vm)
focal_class.full_signature: public void detachVirtualMachine(final VirtualMachine vm)
focal_class.identifier: detachVirtualMachine
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine vm)
focal_class.return: void
focal_class.signature: void detachVirtualMachine(final VirtualMachine vm)
focal_class.class_method_signature: VirtualMachineDAO.deleteNotManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.full_signature: public void deleteNotManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.identifier: deleteNotManagedVirtualMachines
focal_class.modifiers: public
focal_class.parameters: (final Hypervisor hypervisor)
focal_class.return: void
focal_class.signature: void deleteNotManagedVirtualMachines(final Hypervisor hypervisor)
focal_class.class_method_signature: VirtualMachineDAO.defineOrderBy(final String orderBy, final Boolean asc)
focal_class.full_signature: private String defineOrderBy(final String orderBy, final Boolean asc)
focal_class.identifier: defineOrderBy
focal_class.modifiers: private
focal_class.parameters: (final String orderBy, final Boolean asc)
focal_class.return: String
focal_class.signature: String defineOrderBy(final String orderBy, final Boolean asc)
focal_class.superclass: extends DefaultDAOBase<Integer, VirtualMachine>
focal_method.body: public List<VirtualMachine> findVirtualMachinesNotAllocatedCompatibleHypervisor(
          final Hypervisor hypervisor)
      {
          Criteria criteria = createCriteria();
          criteria.createAlias(VirtualMachine.VIRTUAL_MACHINE_TEMPLATE_PROPERTY, "template");
          Restrictions.and(Restrictions.eq(VirtualMachine.HYPERVISOR_PROPERTY, null), Restrictions
              .in("template." + VirtualMachineTemplate.DISKFORMAT_TYPE_PROPERTY, Arrays
                  .asList(hypervisor.getType().compatibleFormats)));
          criteria.addOrder(Order.asc(VirtualMachine.NAME_PROPERTY));
          List<VirtualMachine> result = getResultList(criteria);
          return result;
      }
focal_method.class_method_signature: VirtualMachineDAO.findVirtualMachinesNotAllocatedCompatibleHypervisor(
          final Hypervisor hypervisor)
focal_method.full_signature: public List<VirtualMachine> findVirtualMachinesNotAllocatedCompatibleHypervisor(
          final Hypervisor hypervisor)
focal_method.identifier: findVirtualMachinesNotAllocatedCompatibleHypervisor
focal_method.invocations: createCriteria createAlias and eq in asList getType addOrder asc getResultList
focal_method.modifiers: public
focal_method.parameters: (
          final Hypervisor hypervisor)
focal_method.return: List<VirtualMachine>
focal_method.signature: List<VirtualMachine> findVirtualMachinesNotAllocatedCompatibleHypervisor(
          final Hypervisor hypervisor)