Package org.apache.airavata.persistance.registry.jpa.model

Examples of org.apache.airavata.persistance.registry.jpa.model.AdvancedInputDataHandling


    public void save() throws RegistryException{
        EntityManager em = null;
        try {
            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            AdvancedInputDataHandling dataHandling;
            if (dataHandlingId != 0) {
                dataHandling = em.find(AdvancedInputDataHandling.class, dataHandlingId);
                dataHandling.setDataHandlingId(dataHandlingId);
            } else {
                dataHandling = new AdvancedInputDataHandling();
            }
            Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
            if (taskDetailResource != null) {
                TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
                dataHandling.setTaskId(taskDetailResource.getTaskId());
                dataHandling.setTask(taskDetail);
            }
            dataHandling.setExpId(experimentResource.getExpID());
            dataHandling.setExperiment(experiment);
            dataHandling.setWorkingDir(workingDir);
            dataHandling.setParentWorkingDir(workingDirParent);
            dataHandling.setStageInputsToWorkingDir(stageInputFiles);
            dataHandling.setCleanAfterJob(cleanAfterJob);
            em.persist(dataHandling);
            dataHandlingId = dataHandling.getDataHandlingId();
            em.getTransaction().commit();
            em.close();
        }catch (Exception e){
            logger.error(e.getMessage(), e);
            throw new RegistryException(e);
View Full Code Here

TOP

Related Classes of org.apache.airavata.persistance.registry.jpa.model.AdvancedInputDataHandling

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.