Package org.apache.aiaravata.application.catalog.data.util

Examples of org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator.selectQuery()


      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_INTERFACE);
      generator.setParameter(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID, ids.get(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID));
      generator.setParameter(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID, ids.get(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID));
      Query q = generator.selectQuery(em);
      DataMovementInterface dataMovementInterface = (DataMovementInterface) q.getSingleResult();
      DataMovementInterfaceResource dataMovementInterfaceResource = (DataMovementInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_INTERFACE, dataMovementInterface);
      em.getTransaction().commit();
      em.close();
      return dataMovementInterfaceResource;
View Full Code Here


      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_INTERFACE);
      Query q;
      if ((fieldName.equals(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID)) || (fieldName.equals(DataMovementInterfaceConstants.DATA_MOVEMENT_PROTOCOL)) || (fieldName.equals(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID)) || (fieldName.equals(DataMovementInterfaceConstants.PRIORITY_ORDER))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          DataMovementInterface dataMovementInterface = (DataMovementInterface) result;
          DataMovementInterfaceResource dataMovementInterfaceResource = (DataMovementInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_INTERFACE, dataMovementInterface);
          dataMovementInterfaceResources.add(dataMovementInterfaceResource);
View Full Code Here

      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(DATA_MOVEMENT_INTERFACE);
      Query q;
      if ((fieldName.equals(DataMovementInterfaceConstants.COMPUTE_RESOURCE_ID)) || (fieldName.equals(DataMovementInterfaceConstants.DATA_MOVEMENT_PROTOCOL)) || (fieldName.equals(DataMovementInterfaceConstants.DATA_MOVEMENT_INTERFACE_ID)) || (fieldName.equals(DataMovementInterfaceConstants.PRIORITY_ORDER))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          DataMovementInterface dataMovementInterface = (DataMovementInterface) result;
          DataMovementInterfaceResource dataMovementInterfaceResource = (DataMovementInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.DATA_MOVEMENT_INTERFACE, dataMovementInterface);
          dataMovementInterfaceResourceIDs.add(dataMovementInterfaceResource.getComputeResourceId());
View Full Code Here

        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GATEWAY_PROFILE);
            generator.setParameter(GatewayProfileConstants.GATEWAY_ID, identifier);
            Query q = generator.selectQuery(em);
            GatewayProfile gatewayProfile = (GatewayProfile) q.getSingleResult();
            GatewayProfileResource gatewayProfileResource =
                    (GatewayProfileResource) AppCatalogJPAUtils.getResource(
                            AppCatalogResourceType.GATEWAY_PROFILE, gatewayProfile);
            em.getTransaction().commit();
View Full Code Here

            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GATEWAY_PROFILE);
            List results;
            if (fieldName.equals(GatewayProfileConstants.GATEWAY_ID)) {
                generator.setParameter(GatewayProfileConstants.GATEWAY_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GatewayProfile gatewayProfile = (GatewayProfile) result;
                        GatewayProfileResource gatewayProfileResource =
View Full Code Here

                        gatewayProfileResources.add(gatewayProfileResource);
                    }
                }
            } else if (fieldName.equals(GatewayProfileConstants.GATEWAY_NAME)) {
                generator.setParameter(GatewayProfileConstants.GATEWAY_NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GatewayProfile gatewayProfile = (GatewayProfile) result;
                        GatewayProfileResource gatewayProfileResource =
View Full Code Here

            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GATEWAY_PROFILE);
            List results;
            if (fieldName.equals(GatewayProfileConstants.GATEWAY_ID)) {
                generator.setParameter(GatewayProfileConstants.GATEWAY_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GatewayProfile gatewayProfile = (GatewayProfile) result;
                        gatewayProfileResourceIDs.add(gatewayProfile.getGatewayID());
View Full Code Here

                        gatewayProfileResourceIDs.add(gatewayProfile.getGatewayID());
                    }
                }
            } else if (fieldName.equals(GatewayProfileConstants.GATEWAY_NAME)) {
                generator.setParameter(GatewayProfileConstants.GATEWAY_NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GatewayProfile gatewayProfile = (GatewayProfile) result;
                        gatewayProfileResourceIDs.add(gatewayProfile.getGatewayID());
View Full Code Here

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(HOST_IPADDRESS);
            generator.setParameter(HostIPAddressConstants.RESOURCE_ID, ids.get(HostIPAddressConstants.RESOURCE_ID));
            generator.setParameter(HostIPAddressConstants.IP_ADDRESS, ids.get(HostIPAddressConstants.IP_ADDRESS));
            Query q = generator.selectQuery(em);
            HostIPAddress hostIPAddress = (HostIPAddress) q.getSingleResult();
            HostIPAddressResource hostIPAddressResource =
                    (HostIPAddressResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.HOST_IPADDRESS, hostIPAddress);
            em.getTransaction().commit();
            em.close();
View Full Code Here

            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(HOST_IPADDRESS);
            List results;
            if (fieldName.equals(HostIPAddressConstants.IP_ADDRESS)) {
                generator.setParameter(HostIPAddressConstants.IP_ADDRESS, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        HostIPAddress hostIPAddress = (HostIPAddress) result;
                        HostIPAddressResource hostIPAddressResource =
View Full Code Here

TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.