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

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


            EntityManager em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
          QueryGenerator generator = new QueryGenerator(EXPERIMENT);
          generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
          Query q = generator.selectQuery(em);
            Experiment experiment = (Experiment) q.getSingleResult();
            ExperimentResource experimentResource = (ExperimentResource)
                    Utils.getResource(ResourceType.EXPERIMENT, experiment);
            em.getTransaction().commit();
            em.close();
            return experimentResource;
View Full Code Here


          generator.setParameter(ExperimentConstants.PROJECT_NAME, name);
          Query q = generator.selectQuery(em);
            List<?> results = q.getResultList();
            if (results.size() != 0) {
                for (Object result : results) {
                    Experiment experiment = (Experiment) result;
                    ExperimentResource experimentResource = (ExperimentResource)
                            Utils.getResource(ResourceType.EXPERIMENT, experiment);
                    resourceList.add(experimentResource);
                }
            }
View Full Code Here

        EntityManager em = ResourceUtils.getEntityManager();
        em.getTransaction().begin();
        QueryGenerator queryGenerator = new QueryGenerator(EXPERIMENT);
        queryGenerator.setParameter(ExperimentConstants.EXPERIMENT_ID, keys[0]);
        Query q = queryGenerator.selectQuery(em);
        Experiment experiment = (Experiment)q.getSingleResult();
        ExperimentResource experimentResource =
                (ExperimentResource)Utils.getResource(ResourceType.EXPERIMENT, experiment);
        em.getTransaction().commit();
        em.close();
        list.add(experimentResource);
View Full Code Here

    /**
     * save experiment
     */
    public void save() {
        EntityManager em = ResourceUtils.getEntityManager();
        Experiment existingExp = em.find(Experiment.class, expID);
        em.close();

        em = ResourceUtils.getEntityManager();
        em.getTransaction().begin();
        Experiment experiment = new Experiment();
        Project projectmodel = em.find(Project.class, project.getName());
        experiment.setProject(projectmodel);
        Users user = em.find(Users.class, getWorker().getUser());
        Gateway gateway = em.find(Gateway.class, getGateway().getGatewayName());
        experiment.setProject(projectmodel);
        experiment.setExperiment_ID(getExpID());
        experiment.setUser(user);
        experiment.setGateway(gateway);
        experiment.setSubmitted_date(submittedDate);
        if(existingExp != null){
            existingExp.setGateway(gateway);
            existingExp.setProject(projectmodel);
            existingExp.setUser(user);
            existingExp.setSubmitted_date(submittedDate);
View Full Code Here

          QueryGenerator generator = new QueryGenerator(EXPERIMENT);
//          generator.setParameter(ExperimentConstants.PROJECT_NAME, name);
//          generator.setParameter(ExperimentConstants.USERNAME, getWorker().getUser());
          generator.setParameter(ExperimentConstants.EXPERIMENT_ID, name);
          Query q = generator.selectQuery(em);
            Experiment experiment = (Experiment) q.getSingleResult();
            ExperimentResource experimentResource = (ExperimentResource)
                    Utils.getResource(ResourceType.EXPERIMENT, experiment);
            em.getTransaction().commit();
            em.close();
            return experimentResource;
View Full Code Here

          generator.setParameter(ExperimentConstants.PROJECT_NAME, name);
          Query q = generator.selectQuery(em);
            List<?> results = q.getResultList();
            if (results.size() != 0) {
                for (Object result : results) {
                    Experiment experiment = (Experiment) result;
                    ExperimentResource experimentResource = (ExperimentResource)
                            Utils.getResource(ResourceType.EXPERIMENT, experiment);
                    resourceList.add(experimentResource);
                }
            }
View Full Code Here

            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            Experiment_Input exInput = new Experiment_Input();
            exInput.setEx_key(experimentKey);
            Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
            exInput.setExperiment(experiment);
            exInput.setExperiment_id(experiment.getExpId());
            if (value != null){
                exInput.setValue(value.toCharArray());
            }
            exInput.setInputType(inputType);
            exInput.setMetadata(metadata);

            if (existingInput != null) {
                existingInput.setEx_key(experimentKey);
                existingInput.setExperiment(experiment);
                existingInput.setExperiment_id(experiment.getExpId());
                if (value != null){
                    existingInput.setValue(value.toCharArray());
                }
                existingInput.setInputType(inputType);
                existingInput.setMetadata(metadata);
View Full Code Here

            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            Experiment_Output exOutput = new Experiment_Output();
            exOutput.setEx_key(experimentKey);
            Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
            exOutput.setExperiment(experiment);
            exOutput.setExperiment_id(experiment.getExpId());
            if (value != null){
                exOutput.setValue(value.toCharArray());
            }
            exOutput.setOutputKeyType(outputType);
            exOutput.setMetadata(metadata);

            if (existingOutput != null) {
                existingOutput.setEx_key(experimentKey);
                existingOutput.setExperiment(experiment);
                if (value != null){
                    existingOutput.setValue(value.toCharArray());
                }
                existingOutput.setExperiment_id(experiment.getExpId());
                existingOutput.setOutputKeyType(outputType);
                existingOutput.setMetadata(metadata);
                exOutput = em.merge(existingOutput);
            } else {
                em.persist(exOutput);
View Full Code Here

            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            Experiment_Input exInput = new Experiment_Input();
            exInput.setEx_key(experimentKey);
            Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
            exInput.setExperiment(experiment);
            exInput.setExperiment_id(experiment.getExpId());
            exInput.setValue(value);
            exInput.setInputType(inputType);
            exInput.setMetadata(metadata);

            if (existingInput != null) {
                existingInput.setEx_key(experimentKey);
                existingInput.setExperiment(experiment);
                existingInput.setExperiment_id(experiment.getExpId());
                existingInput.setValue(value);
                existingInput.setInputType(inputType);
                existingInput.setMetadata(metadata);
                exInput = em.merge(existingInput);
            } else {
View Full Code Here

        EntityManager em = null;
        try {
            em = ResourceUtils.getEntityManager();
            em.getTransaction().begin();
            QosParam qosParam = new QosParam();
            Experiment experiment = em.find(Experiment.class, experimentResource.getExpID());
            if (taskDetailResource != null) {
                TaskDetail taskDetail = em.find(TaskDetail.class, taskDetailResource.getTaskId());
                qosParam.setTaskId(taskDetailResource.getTaskId());
                qosParam.setTask(taskDetail);
            }
View Full Code Here

TOP

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

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.