test_class.declarator: vmGenerator
test_class.modifier: private
test_class.original_string: private VirtualMachineGenerator vmGenerator;
test_class.type: VirtualMachineGenerator
test_class.var_name: vmGenerator
test_class.declarator: diskGenerator
test_class.modifier: private
test_class.original_string: private DiskManagementGenerator diskGenerator;
test_class.type: DiskManagementGenerator
test_class.var_name: diskGenerator
test_class.declarator: volumeGenerator
test_class.modifier: private
test_class.original_string: private VolumeManagementGenerator volumeGenerator;
test_class.type: VolumeManagementGenerator
test_class.var_name: volumeGenerator
test_class.file: model/src/test/java/com/abiquo/server/core/infrastructure/management/RasdManagementDAOTest.java
test_class.identifier: RasdManagementDAOTest
test_class.superclass: extends DefaultDAOTestBase<RasdManagementDAO, RasdManagement>
test_case.body: @Test
      public void testFindDisksAndVolumesByVirtualMachine()
      {
          VolumeManagement vol1 = volumeGenerator.createUniqueInstance();
          VolumeManagement vol2 =
              volumeGenerator.createInstance(vol1.getStoragePool(), vol1.getVirtualDatacenter());
          VirtualMachine vm = vmGenerator.createInstance(vol1.getVirtualDatacenter().getEnterprise());
          DiskManagement disk1 = diskGenerator.createInstance(vol1.getVirtualDatacenter());
          DiskManagement disk2 = diskGenerator.createInstance(vol1.getVirtualDatacenter());
  
          vol1.setVirtualMachine(vm);
          vol2.setVirtualMachine(vm);
          disk1.setVirtualMachine(vm);
          disk2.setVirtualMachine(vm);
  
          // Set order to test DAO ordering
          disk1.setSequence(4);
          disk2.setSequence(1);
          vol1.setSequence(2);
          vol2.setSequence(3);
  
          List<Object> entitiesToPersist = new ArrayList<Object>();
          volumeGenerator.addAuxiliaryEntitiesToPersist(vol1, entitiesToPersist);
          persistAll(ds(), entitiesToPersist, vol1, vol2.getRasd(), vol2, disk1.getRasd(), disk1,
              disk2.getRasd(), disk2);
  
          RasdManagementDAO dao = createDaoForRollbackTransaction();
          List<RasdManagement> disks = dao.findDisksAndVolumesByVirtualMachine(vm);
  
          assertNotNull(disks);
          assertEquals(disks.size(), 4);
  
          assertEquals((int) disks.get(0).getSequence(), 1);
          assertEquals((int) disks.get(1).getSequence(), 2);
          assertEquals((int) disks.get(2).getSequence(), 3);
          assertEquals((int) disks.get(3).getSequence(), 4);
  
          assertTrue(disks.get(0) instanceof DiskManagement);
          assertTrue(disks.get(1) instanceof VolumeManagement);
          assertTrue(disks.get(2) instanceof VolumeManagement);
          assertTrue(disks.get(3) instanceof DiskManagement);
      }
test_case.class_method_signature: RasdManagementDAOTest.testFindDisksAndVolumesByVirtualMachine()
test_case.full_signature: @Test public void testFindDisksAndVolumesByVirtualMachine()
test_case.identifier: testFindDisksAndVolumesByVirtualMachine
test_case.invocations: createUniqueInstance createInstance getStoragePool getVirtualDatacenter createInstance getEnterprise getVirtualDatacenter createInstance getVirtualDatacenter createInstance getVirtualDatacenter setVirtualMachine setVirtualMachine setVirtualMachine setVirtualMachine setSequence setSequence setSequence setSequence addAuxiliaryEntitiesToPersist persistAll ds getRasd getRasd getRasd createDaoForRollbackTransaction findDisksAndVolumesByVirtualMachine assertNotNull assertEquals size assertEquals getSequence get assertEquals getSequence get assertEquals getSequence get assertEquals getSequence get assertTrue get assertTrue get assertTrue get assertTrue get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFindDisksAndVolumesByVirtualMachine()
focal_class.file: model/src/main/java/com/abiquo/server/core/infrastructure/management/RasdManagementDAO.java
focal_class.identifier: RasdManagementDAO
focal_class.class_method_signature: RasdManagementDAO.RasdManagementDAO()
focal_class.full_signature: public  RasdManagementDAO()
focal_class.identifier: RasdManagementDAO
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.signature:  RasdManagementDAO()
focal_class.class_method_signature: RasdManagementDAO.RasdManagementDAO(final EntityManager entityManager)
focal_class.full_signature: public  RasdManagementDAO(final EntityManager entityManager)
focal_class.identifier: RasdManagementDAO
focal_class.modifiers: public
focal_class.parameters: (final EntityManager entityManager)
focal_class.signature:  RasdManagementDAO(final EntityManager entityManager)
focal_class.class_method_signature: RasdManagementDAO.sameResourceType(final String idResourceType)
focal_class.full_signature: private static Criterion sameResourceType(final String idResourceType)
focal_class.identifier: sameResourceType
focal_class.modifiers: private static
focal_class.parameters: (final String idResourceType)
focal_class.return: Criterion
focal_class.signature: Criterion sameResourceType(final String idResourceType)
focal_class.class_method_signature: RasdManagementDAO.sameVirtualDatacenter(final VirtualDatacenter virtualDatacenter)
focal_class.full_signature: private static Criterion sameVirtualDatacenter(final VirtualDatacenter virtualDatacenter)
focal_class.identifier: sameVirtualDatacenter
focal_class.modifiers: private static
focal_class.parameters: (final VirtualDatacenter virtualDatacenter)
focal_class.return: Criterion
focal_class.signature: Criterion sameVirtualDatacenter(final VirtualDatacenter virtualDatacenter)
focal_class.class_method_signature: RasdManagementDAO.sameVirtualMachine(final VirtualMachine virtualMachine)
focal_class.full_signature: private static Criterion sameVirtualMachine(final VirtualMachine virtualMachine)
focal_class.identifier: sameVirtualMachine
focal_class.modifiers: private static
focal_class.parameters: (final VirtualMachine virtualMachine)
focal_class.return: Criterion
focal_class.signature: Criterion sameVirtualMachine(final VirtualMachine virtualMachine)
focal_class.class_method_signature: RasdManagementDAO.findByVirtualDatacenterAndResourceType(
          final VirtualDatacenter virtualDatacenter, final String resourceType)
focal_class.full_signature: @SuppressWarnings("unchecked") public List<RasdManagement> findByVirtualDatacenterAndResourceType(
          final VirtualDatacenter virtualDatacenter, final String resourceType)
focal_class.identifier: findByVirtualDatacenterAndResourceType
focal_class.modifiers: @SuppressWarnings("unchecked") public
focal_class.parameters: (
          final VirtualDatacenter virtualDatacenter, final String resourceType)
focal_class.return: List<RasdManagement>
focal_class.signature: List<RasdManagement> findByVirtualDatacenterAndResourceType(
          final VirtualDatacenter virtualDatacenter, final String resourceType)
focal_class.class_method_signature: RasdManagementDAO.findByVirtualMachine(final VirtualMachine virtualMachine)
focal_class.full_signature: public List<RasdManagement> findByVirtualMachine(final VirtualMachine virtualMachine)
focal_class.identifier: findByVirtualMachine
focal_class.modifiers: public
focal_class.parameters: (final VirtualMachine virtualMachine)
focal_class.return: List<RasdManagement>
focal_class.signature: List<RasdManagement> findByVirtualMachine(final VirtualMachine virtualMachine)
focal_class.class_method_signature: RasdManagementDAO.findDisksAndVolumesByVirtualMachine(
          final VirtualMachine virtualMachine)
focal_class.full_signature: public List<RasdManagement> findDisksAndVolumesByVirtualMachine(
          final VirtualMachine virtualMachine)
focal_class.identifier: findDisksAndVolumesByVirtualMachine
focal_class.modifiers: public
focal_class.parameters: (
          final VirtualMachine virtualMachine)
focal_class.return: List<RasdManagement>
focal_class.signature: List<RasdManagement> findDisksAndVolumesByVirtualMachine(
          final VirtualMachine virtualMachine)
focal_class.class_method_signature: RasdManagementDAO.enableTemporalOnlyFilter()
focal_class.full_signature: public void enableTemporalOnlyFilter()
focal_class.identifier: enableTemporalOnlyFilter
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void enableTemporalOnlyFilter()
focal_class.class_method_signature: RasdManagementDAO.restoreDefaultFilters()
focal_class.full_signature: public void restoreDefaultFilters()
focal_class.identifier: restoreDefaultFilters
focal_class.modifiers: public
focal_class.parameters: ()
focal_class.return: void
focal_class.signature: void restoreDefaultFilters()
focal_class.superclass: extends DefaultDAOBase<Integer, RasdManagement>
focal_method.body: public List<RasdManagement> findDisksAndVolumesByVirtualMachine(
          final VirtualMachine virtualMachine)
      {
          Criteria crit = createCriteria();
          crit.createAlias(RasdManagement.RASD_PROPERTY, "rasd");
  
          // Add disk resource type filter
          crit.add(Restrictions.in(RasdManagement.ID_RESOURCE_TYPE_PROPERTY, new String[] {
          VolumeManagement.DISCRIMINATOR, DiskManagement.DISCRIMINATOR}));
  
          // Add virtual machine filter
          crit.add(sameVirtualMachine(virtualMachine));
  
          // Order by generation (attachment order)
          crit.addOrder(Order.asc("sequence"));
  
          return getResultList(crit);
      }
focal_method.class_method_signature: RasdManagementDAO.findDisksAndVolumesByVirtualMachine(
          final VirtualMachine virtualMachine)
focal_method.full_signature: public List<RasdManagement> findDisksAndVolumesByVirtualMachine(
          final VirtualMachine virtualMachine)
focal_method.identifier: findDisksAndVolumesByVirtualMachine
focal_method.invocations: createCriteria createAlias add in add sameVirtualMachine addOrder asc getResultList
focal_method.modifiers: public
focal_method.parameters: (
          final VirtualMachine virtualMachine)
focal_method.return: List<RasdManagement>
focal_method.signature: List<RasdManagement> findDisksAndVolumesByVirtualMachine(
          final VirtualMachine virtualMachine)