Package eu.scape_project.planning.model.tree

Examples of eu.scape_project.planning.model.tree.TemplateTree


         * store all templates
         */
        for (TemplateTree template : templates) {

            // we get the template tree ("Public Templates") from the database
            TemplateTree tdb;
            try {
                tdb = (TemplateTree) em.createQuery("select n from TemplateTree n where name = :name")
                    .setParameter("name", template.getName()).getSingleResult();
            } catch (NoResultException e) {
                tdb = new TemplateTree(template.getName(), null);
            }

            if (tdb != null) {

                // we get the templates and add them to the tree
                // and store them
                for (TreeNode n : template.getRoot().getChildren()) {
                    tdb.getRoot().addChild(n);
                    em.persist(n);
                }

                em.persist(em.merge(tdb));
                em.flush();
View Full Code Here

TOP

Related Classes of eu.scape_project.planning.model.tree.TemplateTree

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.