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

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


    public void save() throws RegistryException {
        EntityManager em = null;
        try {
            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            AdvancedOutputDataHandling dataHandling;
            if (outputDataHandlingId != 0 ){
                dataHandling = em.find(AdvancedOutputDataHandling.class, outputDataHandlingId);
                dataHandling.setOutputDataHandlingId(outputDataHandlingId);
            }else {
                dataHandling = new AdvancedOutputDataHandling();
            }
            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.setDataRegUrl(dataRegUrl);
            dataHandling.setOutputDataDir(outputDataDir);
            dataHandling.setPersistOutputData(persistOutputData);
            em.persist(dataHandling);
            outputDataHandlingId = dataHandling.getOutputDataHandlingId();
            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.AdvancedOutputDataHandling

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.