test_class.file: model/src/test/java/com/abiquo/server/core/cloud/stateful/NodeVirtualImageStatefulConversionDAOTest.java
test_class.identifier: NodeVirtualImageStatefulConversionDAOTest
test_class.superclass: extends
      DefaultDAOTestBase<NodeVirtualImageStatefulConversionDAO, NodeVirtualImageStatefulConversion>
test_case.body: @Test
      public void test_findNodeVirtualImageStatefulConversionsByVirtualAppliance()
      {
          NodeVirtualImageStatefulConversion nvisc = eg().createUniqueInstance();
  
          // linking same entities (dc, ent, vapp)
          VirtualApplianceStatefulConversion vasc = nvisc.getVirtualApplianceStatefulConversion();
          Enterprise ent = vasc.getVirtualAppliance().getVirtualDatacenter().getEnterprise();
          Datacenter dc = vasc.getVirtualAppliance().getVirtualDatacenter().getDatacenter();
          VirtualMachineTemplate vi = nvisc.getNodeVirtualImage().getVirtualImage();
          VirtualMachine vm = nvisc.getNodeVirtualImage().getVirtualMachine();
  
          vasc.getUser().setEnterprise(ent);
          vi.setEnterprise(ent);
          vm.setEnterprise(ent);
          vasc.getUser().getRole().setEnterprise(ent);
  
          nvisc.getTier().setDatacenter(dc);
          vi.getRepository().setDatacenter(dc);
  
          nvisc.getNodeVirtualImage().setVirtualAppliance(vasc.getVirtualAppliance());
  
          vm.setUser(vasc.getUser());
          vasc.getUser().getRole().setPrivileges(null);
  
          // persist
          ds().persistAll(dc, ent, vasc.getVirtualAppliance().getVirtualDatacenter(),
              vasc.getVirtualAppliance(), vasc.getUser().getRole(), vasc.getUser(), vasc,
              vi.getCategory(), vi.getRepository(), vi, vm, nvisc.getNodeVirtualImage(),
              nvisc.getTier(), nvisc);
  
          NodeVirtualImageStatefulConversionDAO dao = createDaoForRollbackTransaction();
  
          Collection<NodeVirtualImageStatefulConversion> list =
              dao.findByVirtualAppliance(vasc.getVirtualAppliance());
  
          assertTrue(!list.isEmpty());
          assertSize(list, 1);
          assertEquals(list.iterator().next().getId(), nvisc.getId());
      }
test_case.class_method_signature: NodeVirtualImageStatefulConversionDAOTest.test_findNodeVirtualImageStatefulConversionsByVirtualAppliance()
test_case.full_signature: @Test public void test_findNodeVirtualImageStatefulConversionsByVirtualAppliance()
test_case.identifier: test_findNodeVirtualImageStatefulConversionsByVirtualAppliance
test_case.invocations: createUniqueInstance eg getVirtualApplianceStatefulConversion getEnterprise getVirtualDatacenter getVirtualAppliance getDatacenter getVirtualDatacenter getVirtualAppliance getVirtualImage getNodeVirtualImage getVirtualMachine getNodeVirtualImage setEnterprise getUser setEnterprise setEnterprise setEnterprise getRole getUser setDatacenter getTier setDatacenter getRepository setVirtualAppliance getNodeVirtualImage getVirtualAppliance setUser getUser setPrivileges getRole getUser persistAll ds getVirtualDatacenter getVirtualAppliance getVirtualAppliance getRole getUser getUser getCategory getRepository getNodeVirtualImage getTier createDaoForRollbackTransaction findByVirtualAppliance getVirtualAppliance assertTrue isEmpty assertSize assertEquals getId next iterator getId
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void test_findNodeVirtualImageStatefulConversionsByVirtualAppliance()
focal_class.declarator: QUERY_BY_VIRTUAL_APPLIANCE = "SELECT nvisc "
          + "FROM com.abiquo.server.core.cloud.stateful.NodeVirtualImageStatefulConversion nvisc "
          + ",com.abiquo.server.core.cloud.stateful.VirtualApplianceStatefulConversion vasc "
          + "WHERE nvisc.virtualApplianceStatefulConversion.id = vasc.id "
          + "AND vasc.virtualAppliance.id = :idVirtualAppliance"
focal_class.modifier: private final
focal_class.original_string: private final String QUERY_BY_VIRTUAL_APPLIANCE = "SELECT nvisc "
          + "FROM com.abiquo.server.core.cloud.stateful.NodeVirtualImageStatefulConversion nvisc "
          + ",com.abiquo.server.core.cloud.stateful.VirtualApplianceStatefulConversion vasc "
          + "WHERE nvisc.virtualApplianceStatefulConversion.id = vasc.id "
          + "AND vasc.virtualAppliance.id = :idVirtualAppliance";
focal_class.type: String
focal_class.var_name: QUERY_BY_VIRTUAL_APPLIANCE
focal_class.file: model/src/main/java/com/abiquo/server/core/cloud/stateful/NodeVirtualImageStatefulConversionDAO.java
focal_class.identifier: NodeVirtualImageStatefulConversionDAO
focal_class.class_method_signature: NodeVirtualImageStatefulConversionDAO.NodeVirtualImageStatefulConversionDAO()
focal_class.full_signature: public  NodeVirtualImageStatefulConversionDAO()
focal_class.identifier: NodeVirtualImageStatefulConversionDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  NodeVirtualImageStatefulConversionDAO()
focal_class.class_method_signature: NodeVirtualImageStatefulConversionDAO.NodeVirtualImageStatefulConversionDAO(final EntityManager entityManager)
focal_class.full_signature: public  NodeVirtualImageStatefulConversionDAO(final EntityManager entityManager)
focal_class.identifier: NodeVirtualImageStatefulConversionDAO
focal_class.modifiers: public
focal_class.parameters: (final EntityManager entityManager)
focal_class.signature:  NodeVirtualImageStatefulConversionDAO(final EntityManager entityManager)
focal_class.class_method_signature: NodeVirtualImageStatefulConversionDAO.sameVIConversion(final VirtualImageConversion vic)
focal_class.full_signature: public static Criterion sameVIConversion(final VirtualImageConversion vic)
focal_class.identifier: sameVIConversion
focal_class.modifiers: public static
focal_class.parameters: (final VirtualImageConversion vic)
focal_class.return: Criterion
focal_class.signature: Criterion sameVIConversion(final VirtualImageConversion vic)
focal_class.class_method_signature: NodeVirtualImageStatefulConversionDAO.sameVASConversion(final VirtualApplianceStatefulConversion vasc)
focal_class.full_signature: public static Criterion sameVASConversion(final VirtualApplianceStatefulConversion vasc)
focal_class.identifier: sameVASConversion
focal_class.modifiers: public static
focal_class.parameters: (final VirtualApplianceStatefulConversion vasc)
focal_class.return: Criterion
focal_class.signature: Criterion sameVASConversion(final VirtualApplianceStatefulConversion vasc)
focal_class.class_method_signature: NodeVirtualImageStatefulConversionDAO.findByVirtualImageConversion(
          final VirtualImageConversion virtualImageConversion)
focal_class.full_signature: public Collection<NodeVirtualImageStatefulConversion> findByVirtualImageConversion(
          final VirtualImageConversion virtualImageConversion)
focal_class.identifier: findByVirtualImageConversion
focal_class.modifiers: public
focal_class.parameters: (
          final VirtualImageConversion virtualImageConversion)
focal_class.return: Collection<NodeVirtualImageStatefulConversion>
focal_class.signature: Collection<NodeVirtualImageStatefulConversion> findByVirtualImageConversion(
          final VirtualImageConversion virtualImageConversion)
focal_class.class_method_signature: NodeVirtualImageStatefulConversionDAO.findByVirtualApplianceStatefulConversion(
          final VirtualApplianceStatefulConversion virtualApplianceStatefulConversion)
focal_class.full_signature: public Collection<NodeVirtualImageStatefulConversion> findByVirtualApplianceStatefulConversion(
          final VirtualApplianceStatefulConversion virtualApplianceStatefulConversion)
focal_class.identifier: findByVirtualApplianceStatefulConversion
focal_class.modifiers: public
focal_class.parameters: (
          final VirtualApplianceStatefulConversion virtualApplianceStatefulConversion)
focal_class.return: Collection<NodeVirtualImageStatefulConversion>
focal_class.signature: Collection<NodeVirtualImageStatefulConversion> findByVirtualApplianceStatefulConversion(
          final VirtualApplianceStatefulConversion virtualApplianceStatefulConversion)
focal_class.class_method_signature: NodeVirtualImageStatefulConversionDAO.findByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
focal_class.full_signature: public Collection<NodeVirtualImageStatefulConversion> findByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
focal_class.identifier: findByVirtualAppliance
focal_class.modifiers: public
focal_class.parameters: (
          final VirtualAppliance virtualAppliance)
focal_class.return: Collection<NodeVirtualImageStatefulConversion>
focal_class.signature: Collection<NodeVirtualImageStatefulConversion> findByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
focal_class.superclass: extends
      DefaultDAOBase<Integer, NodeVirtualImageStatefulConversion>
focal_method.body: public Collection<NodeVirtualImageStatefulConversion> findByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
      {
          Query query = getSession().createQuery(QUERY_BY_VIRTUAL_APPLIANCE);
          query.setParameter("idVirtualAppliance", virtualAppliance.getId());
  
          return query.list();
      }
focal_method.class_method_signature: NodeVirtualImageStatefulConversionDAO.findByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
focal_method.full_signature: public Collection<NodeVirtualImageStatefulConversion> findByVirtualAppliance(
          final VirtualAppliance virtualAppliance)
focal_method.identifier: findByVirtualAppliance
focal_method.invocations: createQuery getSession setParameter getId list
focal_method.modifiers: public
focal_method.parameters: (
          final VirtualAppliance virtualAppliance)
focal_method.return: Collection<NodeVirtualImageStatefulConversion>
focal_method.signature: Collection<NodeVirtualImageStatefulConversion> findByVirtualAppliance(
          final VirtualAppliance virtualAppliance)