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

Examples of org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator


        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_INPUT);
            generator.setParameter(AppInputConstants.INTERFACE_ID, ids.get(AppInputConstants.INTERFACE_ID));
            generator.setParameter(AppInputConstants.INPUT_KEY, ids.get(AppInputConstants.INPUT_KEY));
            Query q = generator.selectQuery(em);
            ApplicationInput applicationInput = (ApplicationInput) q.getSingleResult();
            ApplicationInputResource applicationInputResource =
                    (ApplicationInputResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_INPUT
                            , applicationInput);
            em.getTransaction().commit();
View Full Code Here


        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_INPUT);
            List results;
            if (fieldName.equals(AppInputConstants.INTERFACE_ID)) {
                generator.setParameter(AppInputConstants.INTERFACE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationInput applicationInput = (ApplicationInput) result;
                        ApplicationInputResource applicationInputResource =
                                (ApplicationInputResource) AppCatalogJPAUtils.getResource(
                                        AppCatalogResourceType.APPLICATION_INPUT, applicationInput);
                        appInputResources.add(applicationInputResource);
                    }
                }
            } else if (fieldName.equals(AppInputConstants.INPUT_KEY)) {
                generator.setParameter(AppInputConstants.INPUT_KEY, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationInput applicationInput = (ApplicationInput) result;
                        ApplicationInputResource applicationInputResource =
                                (ApplicationInputResource) AppCatalogJPAUtils.getResource(
                                        AppCatalogResourceType.APPLICATION_INPUT, applicationInput);
                        appInputResources.add(applicationInputResource);
                    }
                }
            } else if (fieldName.equals(AppInputConstants.DATA_TYPE)) {
                generator.setParameter(AppInputConstants.DATA_TYPE, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationInput applicationInput = (ApplicationInput) result;
                        ApplicationInputResource applicationInputResource =
View Full Code Here

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_INPUT);
            List results;
            if (fieldName.equals(AppInputConstants.INTERFACE_ID)) {
                generator.setParameter(AppInputConstants.INTERFACE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationInput applicationInput = (ApplicationInput) result;
                        appInputResourceIDs.add(applicationInput.getInterfaceID());
                    }
                }
            } else if (fieldName.equals(AppInputConstants.INPUT_KEY)) {
                generator.setParameter(AppInputConstants.INPUT_KEY, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationInput applicationInput = (ApplicationInput) result;
                        appInputResourceIDs.add(applicationInput.getInterfaceID());
                    }
                }
            } else if (fieldName.equals(AppInputConstants.DATA_TYPE)) {
                generator.setParameter(AppInputConstants.DATA_TYPE, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationInput applicationInput = (ApplicationInput) result;
                        appInputResourceIDs.add(applicationInput.getInterfaceID());
View Full Code Here

    }
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_INTERFACE);
      generator.setParameter(JobSubmissionInterfaceConstants.JOB_SUBMISSION_INTERFACE_ID, ids.get(JobSubmissionInterfaceConstants.JOB_SUBMISSION_INTERFACE_ID));
      generator.setParameter(JobSubmissionInterfaceConstants.COMPUTE_RESOURCE_ID, ids.get(JobSubmissionInterfaceConstants.COMPUTE_RESOURCE_ID));
      Query q = generator.deleteQuery(em);
      q.executeUpdate();
      em.getTransaction().commit();
      em.close();
    } catch (ApplicationSettingsException e) {
      logger.error(e.getMessage(), e);
View Full Code Here

    }
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_INTERFACE);
      generator.setParameter(JobSubmissionInterfaceConstants.JOB_SUBMISSION_INTERFACE_ID, ids.get(JobSubmissionInterfaceConstants.JOB_SUBMISSION_INTERFACE_ID));
      generator.setParameter(JobSubmissionInterfaceConstants.COMPUTE_RESOURCE_ID, ids.get(JobSubmissionInterfaceConstants.COMPUTE_RESOURCE_ID));
      Query q = generator.selectQuery(em);
      JobSubmissionInterface jobSubmissionInterface = (JobSubmissionInterface) q.getSingleResult();
      JobSubmissionInterfaceResource jobSubmissionInterfaceResource = (JobSubmissionInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_INTERFACE, jobSubmissionInterface);
      em.getTransaction().commit();
      em.close();
      return jobSubmissionInterfaceResource;
View Full Code Here

    List<Resource> jobSubmissionInterfaceResources = new ArrayList<Resource>();
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_INTERFACE);
      Query q;
      if ((fieldName.equals(JobSubmissionInterfaceConstants.JOB_SUBMISSION_INTERFACE_ID)) || (fieldName.equals(JobSubmissionInterfaceConstants.COMPUTE_RESOURCE_ID)) || (fieldName.equals(JobSubmissionInterfaceConstants.JOB_SUBMISSION_PROTOCOL)) || (fieldName.equals(JobSubmissionInterfaceConstants.PRIORITY_ORDER))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          JobSubmissionInterface jobSubmissionInterface = (JobSubmissionInterface) result;
          JobSubmissionInterfaceResource jobSubmissionInterfaceResource = (JobSubmissionInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_INTERFACE, jobSubmissionInterface);
          jobSubmissionInterfaceResources.add(jobSubmissionInterfaceResource);
View Full Code Here

    List<String> jobSubmissionInterfaceResourceIDs = new ArrayList<String>();
    EntityManager em = null;
    try {
      em = AppCatalogJPAUtils.getEntityManager();
      em.getTransaction().begin();
      AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(JOB_SUBMISSION_INTERFACE);
      Query q;
      if ((fieldName.equals(JobSubmissionInterfaceConstants.JOB_SUBMISSION_INTERFACE_ID)) || (fieldName.equals(JobSubmissionInterfaceConstants.COMPUTE_RESOURCE_ID)) || (fieldName.equals(JobSubmissionInterfaceConstants.JOB_SUBMISSION_PROTOCOL)) || (fieldName.equals(JobSubmissionInterfaceConstants.PRIORITY_ORDER))) {
        generator.setParameter(fieldName, value);
        q = generator.selectQuery(em);
        List<?> results = q.getResultList();
        for (Object result : results) {
          JobSubmissionInterface jobSubmissionInterface = (JobSubmissionInterface) result;
          JobSubmissionInterfaceResource jobSubmissionInterfaceResource = (JobSubmissionInterfaceResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.JOB_SUBMISSION_INTERFACE, jobSubmissionInterface);
          jobSubmissionInterfaceResourceIDs.add(jobSubmissionInterfaceResource.getComputeResourceId());
View Full Code Here

        }
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator= new AppCatalogQueryGenerator(LIBRARY_APEND_PATH);
            generator.setParameter(LibraryApendPathConstants.DEPLOYMENT_ID, ids.get(LibraryApendPathConstants.DEPLOYMENT_ID));
            generator.setParameter(LibraryApendPathConstants.NAME, ids.get(LibraryApendPathConstants.NAME));
            Query q = generator.deleteQuery(em);
            q.executeUpdate();
            em.getTransaction().commit();
            em.close();
        } catch (ApplicationSettingsException e) {
            logger.error(e.getMessage(), e);
View Full Code Here

        }
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(LIBRARY_APEND_PATH);
            generator.setParameter(LibraryApendPathConstants.DEPLOYMENT_ID, ids.get(LibraryApendPathConstants.DEPLOYMENT_ID));
            generator.setParameter(LibraryApendPathConstants.NAME, ids.get(LibraryApendPathConstants.NAME));
            Query q = generator.selectQuery(em);
            LibraryApendPath libraryApendPath = (LibraryApendPath) q.getSingleResult();
            LibraryApendPathResource resource =
                    (LibraryApendPathResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.LIBRARY_APEND_PATH, libraryApendPath);
            em.getTransaction().commit();
            em.close();
View Full Code Here

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            Query q;
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(LIBRARY_APEND_PATH);
            List results;
            if (fieldName.equals(LibraryApendPathConstants.DEPLOYMENT_ID)) {
                generator.setParameter(LibraryApendPathConstants.DEPLOYMENT_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        LibraryApendPath prepandPath = (LibraryApendPath) result;
                        LibraryApendPathResource resource =
                                (LibraryApendPathResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.LIBRARY_APEND_PATH, prepandPath);
                        libApPathList.add(resource);
                    }
                }
            } else if (fieldName.equals(LibraryApendPathConstants.NAME)) {
                generator.setParameter(LibraryApendPathConstants.NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        LibraryApendPath prepandPath = (LibraryApendPath) result;
                        LibraryApendPathResource resource =
View Full Code Here

TOP

Related Classes of org.apache.aiaravata.application.catalog.data.util.AppCatalogQueryGenerator

Copyright © 2018 www.massapicom. 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.