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

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


            em.getTransaction().begin();
            AppCatalogQueryGenerator generator = new AppCatalogQueryGenerator(APPLICATION_OUTPUT);
            generator.setParameter(AppOutputConstants.INTERFACE_ID, ids.get(AppOutputConstants.INTERFACE_ID));
            generator.setParameter(AppOutputConstants.OUTPUT_KEY, ids.get(AppOutputConstants.OUTPUT_KEY));
            Query q = generator.selectQuery(em);
            ApplicationOutput applicationOutput = (ApplicationOutput) q.getSingleResult();
            ApplicationOutputResource applicationOutputResource =
                    (ApplicationOutputResource) AppCatalogJPAUtils.getResource(AppCatalogResourceType.APPLICATION_OUTPUT
                            , applicationOutput);
            em.getTransaction().commit();
            em.close();
View Full Code Here


                generator.setParameter(AppOutputConstants.INTERFACE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationOutput applicationOutput = (ApplicationOutput) result;
                        ApplicationOutputResource applicationOutputResource =
                                (ApplicationOutputResource) AppCatalogJPAUtils.getResource(
                                        AppCatalogResourceType.APPLICATION_OUTPUT, applicationOutput);
                        appInputResources.add(applicationOutputResource);
                    }
                }
            } else if (fieldName.equals(AppOutputConstants.OUTPUT_KEY)) {
                generator.setParameter(AppOutputConstants.OUTPUT_KEY, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationOutput applicationOutput = (ApplicationOutput) result;
                        ApplicationOutputResource applicationOutputResource =
                                (ApplicationOutputResource) AppCatalogJPAUtils.getResource(
                                        AppCatalogResourceType.APPLICATION_OUTPUT, applicationOutput);
                        appInputResources.add(applicationOutputResource);
                    }
                }
            } else if (fieldName.equals(AppOutputConstants.DATA_TYPE)) {
                generator.setParameter(AppOutputConstants.DATA_TYPE, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationOutput applicationOutput = (ApplicationOutput) result;
                        ApplicationOutputResource applicationOutputResource =
                                (ApplicationOutputResource) AppCatalogJPAUtils.getResource(
                                        AppCatalogResourceType.APPLICATION_OUTPUT, applicationOutput);
                        appInputResources.add(applicationOutputResource);
                    }
View Full Code Here

                generator.setParameter(AppOutputConstants.INTERFACE_ID, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationOutput applicationOutput = (ApplicationOutput) result;
                        appOutputResourceIDs.add(applicationOutput.getInterfaceID());
                    }
                }
            }
            if (fieldName.equals(AppOutputConstants.OUTPUT_KEY)) {
                generator.setParameter(AppOutputConstants.OUTPUT_KEY, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationOutput applicationOutput = (ApplicationOutput) result;
                        appOutputResourceIDs.add(applicationOutput.getInterfaceID());
                    }
                }
            } else if (fieldName.equals(AppOutputConstants.DATA_TYPE)) {
                generator.setParameter(AppOutputConstants.DATA_TYPE, value);
                q = generator.selectQuery(em);
                results = q.getResultList();
                if (results.size() != 0) {
                    for (Object result : results) {
                        ApplicationOutput applicationOutput = (ApplicationOutput) result;
                        appOutputResourceIDs.add(applicationOutput.getInterfaceID());
                    }
                }
            } else {
                em.getTransaction().commit();
                em.close();
View Full Code Here

    public void save() throws AppCatalogException {
        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            ApplicationOutput existingApplicationOutput = em.find(ApplicationOutput.class,
                    new AppOutput_PK(interfaceID, outputKey));
            em.close();

            em = AppCatalogJPAUtils.getEntityManager();
            em.getTransaction().begin();
            if (existingApplicationOutput != null) {
                existingApplicationOutput.setInterfaceID(interfaceID);
                ApplicationInterface applicationInterface = em.find(ApplicationInterface.class, interfaceID);
                existingApplicationOutput.setApplicationInterface(applicationInterface);
                existingApplicationOutput.setDataType(dataType);
                existingApplicationOutput.setOutputKey(outputKey);
                existingApplicationOutput.setOutputVal(outputVal);
                em.merge(existingApplicationOutput);
            } else {
                ApplicationOutput applicationOutput = new ApplicationOutput();
                applicationOutput.setInterfaceID(interfaceID);
                ApplicationInterface applicationInterface = em.find(ApplicationInterface.class, interfaceID);
                applicationOutput.setApplicationInterface(applicationInterface);
                applicationOutput.setDataType(dataType);
                applicationOutput.setOutputKey(outputKey);
                applicationOutput.setOutputVal(outputVal);
                em.persist(applicationOutput);
            }
            em.getTransaction().commit();
            em.close();
        } catch (Exception e) {
View Full Code Here

        }

        EntityManager em = null;
        try {
            em = AppCatalogJPAUtils.getEntityManager();
            ApplicationOutput applicationOutput = em.find(ApplicationOutput.class, new AppOutput_PK(
                    ids.get(AppOutputConstants.INTERFACE_ID),
                    ids.get(AppOutputConstants.OUTPUT_KEY)));

            em.close();
            return applicationOutput != null;
View Full Code Here

TOP

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

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.