test_class.declarator: virtualMachineGenerator
test_class.modifier: private
test_class.original_string: private VirtualMachineGenerator virtualMachineGenerator;
test_class.type: VirtualMachineGenerator
test_class.var_name: virtualMachineGenerator
test_class.declarator: virtualApplianceGenerator
test_class.modifier: private
test_class.original_string: private VirtualApplianceGenerator virtualApplianceGenerator;
test_class.type: VirtualApplianceGenerator
test_class.var_name: virtualApplianceGenerator
test_class.declarator: vapp
test_class.modifier: private
test_class.original_string: private VirtualAppliance vapp;
test_class.type: VirtualAppliance
test_class.var_name: vapp
test_class.declarator: vmachine
test_class.modifier: private
test_class.original_string: private VirtualMachine vmachine;
test_class.type: VirtualMachine
test_class.var_name: vmachine
test_class.declarator: virtualImageGenerator
test_class.modifier: private
test_class.original_string: private VirtualMachineTemplateGenerator virtualImageGenerator;
test_class.type: VirtualMachineTemplateGenerator
test_class.var_name: virtualImageGenerator
test_class.declarator: vimage
test_class.modifier: private
test_class.original_string: private VirtualMachineTemplate vimage;
test_class.type: VirtualMachineTemplate
test_class.var_name: vimage
test_class.declarator: categoryGenerator
test_class.modifier: private
test_class.original_string: private CategoryGenerator categoryGenerator;
test_class.type: CategoryGenerator
test_class.var_name: categoryGenerator
test_class.file: model/src/test/java/com/abiquo/server/core/cloud/NodeVirtualImageDAOTest.java
test_class.identifier: NodeVirtualImageDAOTest
test_class.superclass: extends
      DefaultDAOTestBase<NodeVirtualImageDAO, NodeVirtualImage>
test_case.body: @Test
      public void findByEnterprise()
      {
          EnterpriseGenerator enterpriseGenerator = new EnterpriseGenerator(getSeed());
          Enterprise enterprise = enterpriseGenerator.createUniqueInstance();
          Enterprise enterprise2 = enterpriseGenerator.createUniqueInstance();
  
          VirtualMachineGenerator vMachineGenerator = new VirtualMachineGenerator(getSeed());
          VirtualMachine vm1 = vMachineGenerator.createInstance(enterprise);
          VirtualMachine vm2 = vMachineGenerator.createInstance(enterprise);
          VirtualMachine vm3 = vMachineGenerator.createInstance(enterprise2);
  
          VirtualDatacenterGenerator vdcGenerator = new VirtualDatacenterGenerator(getSeed());
          VirtualDatacenter vdc = vdcGenerator.createInstance(enterprise);
          VirtualDatacenter vdc2 = vdcGenerator.createInstance(enterprise2);
  
          VirtualApplianceGenerator vApplianceGenerator = new VirtualApplianceGenerator(getSeed());
          VirtualAppliance vAppliance = vApplianceGenerator.createInstance(vdc);
          VirtualAppliance vAppliance2 = vApplianceGenerator.createInstance(vdc2);
  
          NodeVirtualImageGenerator nodeVImageGenerator = new NodeVirtualImageGenerator(getSeed());
          NodeVirtualImage nvi = nodeVImageGenerator.createInstance(vAppliance, vm1);
          NodeVirtualImage nvi2 = nodeVImageGenerator.createInstance(vAppliance, vm2);
          NodeVirtualImage nvi3 = nodeVImageGenerator.createInstance(vAppliance2, vm3);
  
          vm1.getVirtualMachineTemplate().getRepository()
              .setDatacenter(vm1.getHypervisor().getMachine().getRack().getDatacenter());
          vm2.getVirtualMachineTemplate().getRepository()
              .setDatacenter(vm2.getHypervisor().getMachine().getRack().getDatacenter());
          vm3.getVirtualMachineTemplate().getRepository()
              .setDatacenter(vm3.getHypervisor().getMachine().getRack().getDatacenter());
  
          // ds().persistAll(enterprise, enterprise2, vm1.getUser().getRole(), vm1.getUser(),
          // vm1.getHypervisor().getMachine().getDatacenter(),
          // vm1.getHypervisor().getMachine().getRack().getDatacenter(),
          // vm1.getHypervisor().getMachine().getRack(), vm1.getHypervisor().getMachine(),
          // vm1.getHypervisor(), vm1.getVirtualImage(), vm1, vm2.getUser().getRole(),
          // vm2.getUser(), vm2.getHypervisor().getMachine().getRack().getDatacenter(),
          // vm2.getHypervisor().getMachine().getRack(),
          // vm2.getHypervisor().getMachine().getDatacenter(), vm2.getHypervisor().getMachine(),
          // vm2.getHypervisor(), vm2.getVirtualImage(), vm2, vm3.getUser().getRole(),
          // vm3.getUser(), vm3.getHypervisor().getMachine().getRack().getDatacenter(),
          // vm3.getHypervisor().getMachine().getRack(),
          // vm3.getHypervisor().getMachine().getDatacenter(), vm3.getHypervisor().getMachine(),
          // vm3.getHypervisor(), vm3.getVirtualImage(), vm3, vdc.getNetwork(), vdc.getDatacenter(),
          // vdc, vdc2.getNetwork(), vdc2.getDatacenter(), vdc2, vAppliance, vAppliance2, nvi, nvi2,
          // nvi3);
  
          List<Object> entitiesToSetup = new ArrayList<Object>();
  
          entitiesToSetup.add(enterprise);
          entitiesToSetup.add(enterprise2);
          entitiesToSetup.add(vdc.getNetwork());
          entitiesToSetup.add(vdc.getDatacenter());
          entitiesToSetup.add(vdc);
          entitiesToSetup.add(vdc2.getNetwork());
          entitiesToSetup.add(vdc2.getDatacenter());
          entitiesToSetup.add(vdc2);
          entitiesToSetup.add(vAppliance);
          entitiesToSetup.add(vAppliance2);
  
          for (Privilege p : vm1.getUser().getRole().getPrivileges())
          {
              entitiesToSetup.add(p);
          }
  
          entitiesToSetup.add(vm1.getUser().getRole());
          entitiesToSetup.add(vm1.getUser());
          entitiesToSetup.add(vm1.getHypervisor().getMachine().getRack().getDatacenter());
          entitiesToSetup.add(vm1.getHypervisor().getMachine().getRack());
          entitiesToSetup.add(vm1.getHypervisor().getMachine());
          entitiesToSetup.add(vm1.getHypervisor());
          entitiesToSetup.add(vm1.getVirtualMachineTemplate().getRepository());
          entitiesToSetup.add(vm1.getVirtualMachineTemplate().getCategory());
          entitiesToSetup.add(vm1.getVirtualMachineTemplate());
          entitiesToSetup.add(vm1);
          entitiesToSetup.add(nvi);
  
          for (Privilege p : vm2.getUser().getRole().getPrivileges())
          {
              entitiesToSetup.add(p);
          }
  
          entitiesToSetup.add(vm2.getUser().getRole());
          entitiesToSetup.add(vm2.getUser());
          entitiesToSetup.add(vm2.getHypervisor().getMachine().getRack().getDatacenter());
          entitiesToSetup.add(vm2.getHypervisor().getMachine().getRack());
          entitiesToSetup.add(vm2.getHypervisor().getMachine());
          entitiesToSetup.add(vm2.getHypervisor());
          entitiesToSetup.add(vm2.getVirtualMachineTemplate().getRepository());
          entitiesToSetup.add(vm2.getVirtualMachineTemplate().getCategory());
          entitiesToSetup.add(vm2.getVirtualMachineTemplate());
          entitiesToSetup.add(vm2);
          entitiesToSetup.add(nvi2);
  
          for (Privilege p : vm3.getUser().getRole().getPrivileges())
          {
              entitiesToSetup.add(p);
          }
  
          entitiesToSetup.add(vm3.getUser().getRole());
          entitiesToSetup.add(vm3.getUser());
          entitiesToSetup.add(vm3.getHypervisor().getMachine().getRack().getDatacenter());
          entitiesToSetup.add(vm3.getHypervisor().getMachine().getRack());
          entitiesToSetup.add(vm3.getHypervisor().getMachine());
          entitiesToSetup.add(vm3.getHypervisor());
          entitiesToSetup.add(vm3.getVirtualMachineTemplate().getRepository());
          entitiesToSetup.add(vm3.getVirtualMachineTemplate().getCategory());
          entitiesToSetup.add(vm3.getVirtualMachineTemplate());
          entitiesToSetup.add(vm3);
          entitiesToSetup.add(nvi3);
  
          ds().persistAll(entitiesToSetup.toArray());
  
          NodeVirtualImageDAO dao = createDaoForRollbackTransaction();
          List<NodeVirtualImage> list = dao.findByEnterprise(enterprise);
          Assert.assertEquals(list.size(), 2);
      }
test_case.class_method_signature: NodeVirtualImageDAOTest.findByEnterprise()
test_case.full_signature: @Test public void findByEnterprise()
test_case.identifier: findByEnterprise
test_case.invocations: getSeed createUniqueInstance createUniqueInstance getSeed createInstance createInstance createInstance getSeed createInstance createInstance getSeed createInstance createInstance getSeed createInstance createInstance createInstance setDatacenter getRepository getVirtualMachineTemplate getDatacenter getRack getMachine getHypervisor setDatacenter getRepository getVirtualMachineTemplate getDatacenter getRack getMachine getHypervisor setDatacenter getRepository getVirtualMachineTemplate getDatacenter getRack getMachine getHypervisor add add add getNetwork add getDatacenter add add getNetwork add getDatacenter add add add getPrivileges getRole getUser add add getRole getUser add getUser add getDatacenter getRack getMachine getHypervisor add getRack getMachine getHypervisor add getMachine getHypervisor add getHypervisor add getRepository getVirtualMachineTemplate add getCategory getVirtualMachineTemplate add getVirtualMachineTemplate add add getPrivileges getRole getUser add add getRole getUser add getUser add getDatacenter getRack getMachine getHypervisor add getRack getMachine getHypervisor add getMachine getHypervisor add getHypervisor add getRepository getVirtualMachineTemplate add getCategory getVirtualMachineTemplate add getVirtualMachineTemplate add add getPrivileges getRole getUser add add getRole getUser add getUser add getDatacenter getRack getMachine getHypervisor add getRack getMachine getHypervisor add getMachine getHypervisor add getHypervisor add getRepository getVirtualMachineTemplate add getCategory getVirtualMachineTemplate add getVirtualMachineTemplate add add persistAll ds toArray createDaoForRollbackTransaction findByEnterprise assertEquals size
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void findByEnterprise()
focal_class.declarator: MY_QUERY =
          "select nvi.virtualMachine.id from VirtualAppliance v inner join v.nodesVirtualImage nvi where v.id =:vappid"
focal_class.modifier: static final
focal_class.original_string: static final String MY_QUERY =
          "select nvi.virtualMachine.id from VirtualAppliance v inner join v.nodesVirtualImage nvi where v.id =:vappid";
focal_class.type: String
focal_class.var_name: MY_QUERY
focal_class.file: model/src/main/java/com/abiquo/server/core/cloud/NodeVirtualImageDAO.java
focal_class.identifier: NodeVirtualImageDAO
focal_class.class_method_signature: NodeVirtualImageDAO.NodeVirtualImageDAO()
focal_class.full_signature: public  NodeVirtualImageDAO()
focal_class.identifier: NodeVirtualImageDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  NodeVirtualImageDAO()
focal_class.class_method_signature: NodeVirtualImageDAO.NodeVirtualImageDAO(final EntityManager entityManager)
focal_class.full_signature: public  NodeVirtualImageDAO(final EntityManager entityManager)
focal_class.identifier: NodeVirtualImageDAO
focal_class.modifiers: public
focal_class.parameters: (final EntityManager entityManager)
focal_class.signature:  NodeVirtualImageDAO(final EntityManager entityManager)
focal_class.class_method_signature: NodeVirtualImageDAO.sameVirtualMachine(final VirtualMachine vmachine)
focal_class.full_signature: private Criterion sameVirtualMachine(final VirtualMachine vmachine)
focal_class.identifier: sameVirtualMachine
focal_class.modifiers: private
focal_class.parameters: (final VirtualMachine vmachine)
focal_class.return: Criterion
focal_class.signature: Criterion sameVirtualMachine(final VirtualMachine vmachine)
focal_class.class_method_signature: NodeVirtualImageDAO.findVirtualAppliance(final VirtualMachine vmachine)
focal_class.full_signature: public VirtualAppliance findVirtualAppliance(final VirtualMachine vmachine)
focal_class.identifier: findVirtualAppliance
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine vmachine)
focal_class.return: VirtualAppliance
focal_class.signature: VirtualAppliance findVirtualAppliance(final VirtualMachine vmachine)
focal_class.class_method_signature: NodeVirtualImageDAO.findByVirtualMachine(final VirtualMachine vmachine)
focal_class.full_signature: public NodeVirtualImage findByVirtualMachine(final VirtualMachine vmachine)
focal_class.identifier: findByVirtualMachine
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine vmachine)
focal_class.return: NodeVirtualImage
focal_class.signature: NodeVirtualImage findByVirtualMachine(final VirtualMachine vmachine)
focal_class.class_method_signature: NodeVirtualImageDAO.sameEnterprise(final Enterprise enterprise)
focal_class.full_signature: private Criteria sameEnterprise(final Enterprise enterprise)
focal_class.identifier: sameEnterprise
focal_class.modifiers: private
focal_class.parameters: (final Enterprise enterprise)
focal_class.return: Criteria
focal_class.signature: Criteria sameEnterprise(final Enterprise enterprise)
focal_class.class_method_signature: NodeVirtualImageDAO.findByEnterprise(final Enterprise enterprise)
focal_class.full_signature: public List<NodeVirtualImage> findByEnterprise(final Enterprise enterprise)
focal_class.identifier: findByEnterprise
focal_class.modifiers: public
focal_class.parameters: (final Enterprise enterprise)
focal_class.return: List<NodeVirtualImage>
focal_class.signature: List<NodeVirtualImage> findByEnterprise(final Enterprise enterprise)
focal_class.class_method_signature: NodeVirtualImageDAO.findByVirtualImage(final VirtualMachineTemplate virtualImage)
focal_class.full_signature: public List<NodeVirtualImage> findByVirtualImage(final VirtualMachineTemplate virtualImage)
focal_class.identifier: findByVirtualImage
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachineTemplate virtualImage)
focal_class.return: List<NodeVirtualImage>
focal_class.signature: List<NodeVirtualImage> findByVirtualImage(final VirtualMachineTemplate virtualImage)
focal_class.class_method_signature: NodeVirtualImageDAO.sameVirtualImage(final VirtualMachineTemplate virtualImage)
focal_class.full_signature: private Criteria sameVirtualImage(final VirtualMachineTemplate virtualImage)
focal_class.identifier: sameVirtualImage
focal_class.modifiers: private
focal_class.parameters: (final VirtualMachineTemplate virtualImage)
focal_class.return: Criteria
focal_class.signature: Criteria sameVirtualImage(final VirtualMachineTemplate virtualImage)
focal_class.class_method_signature: NodeVirtualImageDAO.findByVirtualAppliance(final VirtualAppliance virtualAppliance)
focal_class.full_signature: public List<NodeVirtualImage> findByVirtualAppliance(final VirtualAppliance virtualAppliance)
focal_class.identifier: findByVirtualAppliance
focal_class.modifiers: public
focal_class.parameters: (final VirtualAppliance virtualAppliance)
focal_class.return: List<NodeVirtualImage>
focal_class.signature: List<NodeVirtualImage> findByVirtualAppliance(final VirtualAppliance virtualAppliance)
focal_class.class_method_signature: NodeVirtualImageDAO.sameVirtualAppliance(final VirtualAppliance virtualAppliance)
focal_class.full_signature: private Criteria sameVirtualAppliance(final VirtualAppliance virtualAppliance)
focal_class.identifier: sameVirtualAppliance
focal_class.modifiers: private
focal_class.parameters: (final VirtualAppliance virtualAppliance)
focal_class.return: Criteria
focal_class.signature: Criteria sameVirtualAppliance(final VirtualAppliance virtualAppliance)
focal_class.class_method_signature: NodeVirtualImageDAO.findVirtualMachineIdsByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
focal_class.full_signature: public List<Integer> findVirtualMachineIdsByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
focal_class.identifier: findVirtualMachineIdsByVirtualAppliance
focal_class.modifiers: public
focal_class.parameters: (
          final VirtualAppliance virtualAppliance)
focal_class.return: List<Integer>
focal_class.signature: List<Integer> findVirtualMachineIdsByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
focal_class.superclass: extends DefaultDAOBase<Integer, NodeVirtualImage>
focal_method.body: public List<NodeVirtualImage> findByEnterprise(final Enterprise enterprise)
      {
          Criteria criteria = sameEnterprise(enterprise);
          List<NodeVirtualImage> result = getResultList(criteria);
          return result;
  
      }
focal_method.class_method_signature: NodeVirtualImageDAO.findByEnterprise(final Enterprise enterprise)
focal_method.full_signature: public List<NodeVirtualImage> findByEnterprise(final Enterprise enterprise)
focal_method.identifier: findByEnterprise
focal_method.invocations: sameEnterprise getResultList
focal_method.modifiers: public
focal_method.parameters: (final Enterprise enterprise)
focal_method.return: List<NodeVirtualImage>
focal_method.signature: List<NodeVirtualImage> findByEnterprise(final Enterprise enterprise)