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

Examples of org.apache.aiaravata.application.catalog.data.model.GSISSHPostJobCommand


            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(GSISSH_POSTJOBCOMMAND);
            generator.setParameter(GSISSHPostJobCommandConstants.SUBMISSION_ID,
                    ids.get(GSISSHPostJobCommandConstants.SUBMISSION_ID));
            generator.setParameter(GSISSHPostJobCommandConstants.COMMAND, ids.get(GSISSHPostJobCommandConstants.COMMAND));
            Query q = generator.selectQuery(em);
            GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) q.getSingleResult();
            GSISSHPostJobCommandResource gsisshPostJobCommandResource =
                    (GSISSHPostJobCommandResource) AppCatalogJPAUtils.getResource(
                            AppCatalogResourceType.GSISSH_POSTJOBCOMMAND, gsisshPostJobCommand);
            em.getTransaction().commit();
            em.close();
View Full Code Here


                generator.setParameter(GSISSHPostJobCommandConstants.SUBMISSION_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
                        GSISSHPostJobCommandResource gsisshPostJobCommandResource =
                                (GSISSHPostJobCommandResource) AppCatalogJPAUtils.getResource(
                                        AppCatalogResourceType.GSISSH_POSTJOBCOMMAND, gsisshPostJobCommand);
                        gsiSSHPostJobCommandResources.add(gsisshPostJobCommandResource);
                    }
                }
            } else if (fieldName.equals(GSISSHPostJobCommandConstants.COMMAND)) {
                generator.setParameter(GSISSHPostJobCommandConstants.COMMAND, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
                        GSISSHPostJobCommandResource gsisshPostJobCommandResource =
                                (GSISSHPostJobCommandResource) AppCatalogJPAUtils.getResource(
                                        AppCatalogResourceType.GSISSH_POSTJOBCOMMAND, gsisshPostJobCommand);
                        gsiSSHPostJobCommandResources.add(gsisshPostJobCommandResource);
                    }
View Full Code Here

                generator.setParameter(GSISSHPostJobCommandConstants.SUBMISSION_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
                        gsiSSHPostJobResourceIDs.add(gsisshPostJobCommand.getSubmissionID());
                    }
                }
            } else if (fieldName.equals(GSISSHPostJobCommandConstants.COMMAND)) {
                generator.setParameter(GSISSHPostJobCommandConstants.COMMAND, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        GSISSHPostJobCommand gsisshPostJobCommand = (GSISSHPostJobCommand) result;
                        gsiSSHPostJobResourceIDs.add(gsisshPostJobCommand.getSubmissionID());
                    }
                }
            } else {
                em.getTransaction().commit();
                em.close();
View Full Code Here

    public void save() throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            GSISSHPostJobCommand existingPostJobCommand = em.find(GSISSHPostJobCommand.class,
                    new GSISSHPostJobCommandPK(submissionID, command));
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            GSISSHSubmission gsisshSubmission = em.find(GSISSHSubmission.class, submissionID);
            if (existingPostJobCommand !=  null){
                existingPostJobCommand.setSubmissionID(submissionID);
                existingPostJobCommand.setCommand(command);
                existingPostJobCommand.setGsisshSubmission(gsisshSubmission);
                em.merge(existingPostJobCommand);
            }else {
                GSISSHPostJobCommand gsisshPostJobCommand = new GSISSHPostJobCommand();
                gsisshPostJobCommand.setSubmissionID(submissionID);
                gsisshPostJobCommand.setCommand(command);
                gsisshPostJobCommand.setGsisshSubmission(gsisshSubmission);
                em.persist(gsisshPostJobCommand);
            }
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
View Full Code Here

        }

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            GSISSHPostJobCommand gsisshPostJobCommand = em.find(GSISSHPostJobCommand.class, new GSISSHPostJobCommandPK(
                    ids.get(GSISSHPostJobCommandConstants.SUBMISSION_ID),
                    ids.get(GSISSHPostJobCommandConstants.COMMAND)));

            em.close();
            return gsisshPostJobCommand != null;
View Full Code Here

TOP

Related Classes of org.apache.aiaravata.application.catalog.data.model.GSISSHPostJobCommand

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.