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

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


            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APP_MODULE_MAPPING);
            generator.setParameter(AppModuleMappingConstants.INTERFACE_ID, ids.get(AppModuleMappingConstants.INTERFACE_ID));
            generator.setParameter(AppModuleMappingConstants.MODULE_ID, ids.get(AppModuleMappingConstants.MODULE_ID));
            Query q = generator.selectQuery(em);
            AppModuleMapping result = (AppModuleMapping) q.getSingleResult();
            AppModuleMappingResource resource =
                    (AppModuleMappingResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APP_MODULE_MAPPING, result);
            em.getTransaction().commit();
            em.close();
            return resource;
View Full Code Here


                generator.setParameter(AppModuleMappingConstants.INTERFACE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        AppModuleMapping moduleMapping = (AppModuleMapping) result;
                        AppModuleMappingResource resource =
                                (AppModuleMappingResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APP_MODULE_MAPPING, moduleMapping);
                        resourceList.add(resource);
                    }
                }
            } else if (fieldName.equals(AppModuleMappingConstants.MODULE_ID)) {
                generator.setParameter(AppModuleMappingConstants.MODULE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        AppModuleMapping moduleMapping = (AppModuleMapping) result;
                        AppModuleMappingResource resource =
                                (AppModuleMappingResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APP_MODULE_MAPPING, moduleMapping);
                        resourceList.add(resource);
                    }
                }
View Full Code Here

    @Override
    public void save() throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            AppModuleMapping existngModuleMap = em.find(AppModuleMapping.class, new AppModuleMapping_PK(interfaceId, moduleId));
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            ApplicationInterface applicationInterface = em.find(ApplicationInterface.class, interfaceId);
            ApplicationModule applicationModule = em.find(ApplicationModule.class, moduleId);
            if (existngModuleMap !=  null){
                existngModuleMap.setApplicationInterface(applicationInterface);
                existngModuleMap.setApplicationModule(applicationModule);
                em.merge(existngModuleMap);
            }else {
                AppModuleMapping appModuleMapping = new AppModuleMapping();
                appModuleMapping.setInterfaceID(interfaceId);
                appModuleMapping.setApplicationInterface(applicationInterface);
                appModuleMapping.setModuleID(moduleId);
                appModuleMapping.setApplicationModule(applicationModule);
                em.persist(appModuleMapping);
            }
            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();
            AppModuleMapping moduleMapping = em.find(AppModuleMapping.class,
                    new AppModuleMapping_PK(ids.get(AppModuleMappingConstants.INTERFACE_ID),
                            ids.get(AppModuleMappingConstants.MODULE_ID)));
            em.close();
            return moduleMapping != null;
        } catch (ApplicationSettingsException e) {
View Full Code Here

TOP

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

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.