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

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


            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APP_ENVIRONMENT);
            generator.setParameter(AppEnvironmentConstants.DEPLOYMENT_ID, ids.get(AppEnvironmentConstants.DEPLOYMENT_ID));
            generator.setParameter(AppEnvironmentConstants.NAME, ids.get(AppEnvironmentConstants.NAME));
            Query q = generator.selectQuery(em);
            AppEnvironment appEnvironment = (AppEnvironment) q.getSingleResult();
            AppEnvironmentResource resource =
                    (AppEnvironmentResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APP_ENVIRONMENT, appEnvironment);
            em.getTransaction().commit();
            em.close();
            return resource;
View Full Code Here


                generator.setParameter(AppEnvironmentConstants.DEPLOYMENT_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        AppEnvironment appEnvironment = (AppEnvironment) result;
                        AppEnvironmentResource resource =
                                (AppEnvironmentResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APP_ENVIRONMENT, appEnvironment);
                        appEnvironmentList.add(resource);
                    }
                }
            } else if (fieldName.equals(AppEnvironmentConstants.NAME)) {
                generator.setParameter(AppEnvironmentConstants.NAME, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        AppEnvironment appEnvironment = (AppEnvironment) result;
                        AppEnvironmentResource resource =
                                (AppEnvironmentResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APP_ENVIRONMENT, appEnvironment);
                        appEnvironmentList.add(resource);
                    }
                }
View Full Code Here

    @Override
    public void save() throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            AppEnvironment existigAppEnv = em.find(AppEnvironment.class, new AppEnvironment_PK(deploymentId, name));
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();

            ApplicationDeployment deployment = em.find(ApplicationDeployment.class, deploymentId);
            if (existigAppEnv !=  null){
                existigAppEnv.setValue(value);
                existigAppEnv.setApplicationDeployment(deployment);
                em.merge(existigAppEnv);
            }else {
                AppEnvironment appEnvironment = new AppEnvironment();
                appEnvironment.setDeploymentID(deploymentId);
                appEnvironment.setName(name);
                appEnvironment.setValue(value);
                appEnvironment.setApplicationDeployment(deployment);
                em.persist(appEnvironment);
            }
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
View Full Code Here

            throw new AppCatalogException("Identifier should be a map with the field name and it's value");
        }
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            AppEnvironment appEnvironment = em.find(AppEnvironment.class,
                    new AppEnvironment_PK(ids.get(AppEnvironmentConstants.DEPLOYMENT_ID),
                            ids.get(AppEnvironmentConstants.NAME)));
            em.close();
            return appEnvironment != null;
        } catch (ApplicationSettingsException e) {
View Full Code Here

TOP

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

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.