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 testFindDisksAndVolumesByVirtualMachineOnlyVolumes()
      {
          VolumeManagement vol1 = volumeGenerator.createUniqueInstance();
          VolumeManagement vol2 =
              volumeGenerator.createInstance(vol1.getStoragePool(), vol1.getVirtualDatacenter());
          VirtualMachine vm = vmGenerator.createInstance(vol1.getVirtualDatacenter().getEnterprise());
  
          vol1.setVirtualMachine(vm);
          vol2.setVirtualMachine(vm);
          // Set reverse order to test DAO ordering
          vol1.setSequence(2);
          vol2.setSequence(1);
  
          List<Object> entitiesToPersist = new ArrayList<Object>();
          volumeGenerator.addAuxiliaryEntitiesToPersist(vol1, entitiesToPersist);
          persistAll(ds(), entitiesToPersist, vol1, vol2.getRasd(), vol2);
  
          RasdManagementDAO dao = createDaoForRollbackTransaction();
          List<RasdManagement> volumes = dao.findDisksAndVolumesByVirtualMachine(vm);
  
          assertNotNull(volumes);
          assertEquals(volumes.size(), 2);
          assertEquals((int) volumes.get(0).getSequence(), 1);
          assertEquals((int) volumes.get(1).getSequence(), 2);
      }
test_case.class_method_signature: RasdManagementDAOTest.testFindDisksAndVolumesByVirtualMachineOnlyVolumes()
test_case.full_signature: @Test public void testFindDisksAndVolumesByVirtualMachineOnlyVolumes()
test_case.identifier: testFindDisksAndVolumesByVirtualMachineOnlyVolumes
test_case.invocations: createUniqueInstance createInstance getStoragePool getVirtualDatacenter createInstance getEnterprise getVirtualDatacenter setVirtualMachine setVirtualMachine setSequence setSequence addAuxiliaryEntitiesToPersist persistAll ds getRasd createDaoForRollbackTransaction findDisksAndVolumesByVirtualMachine assertNotNull assertEquals size assertEquals getSequence get assertEquals getSequence get
test_case.modifiers: @Test public
test_case.parameters: ()
test_case.return: void
test_case.signature: void testFindDisksAndVolumesByVirtualMachineOnlyVolumes()
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)