Package org.hibernate.examples.model

Examples of org.hibernate.examples.model.TreeNodePosition



    public static <T extends HibernateTreeEntity<T>> void updateTreeNodePosition(T entity) {
        assert (entity != null);

        TreeNodePosition np = entity.getNodePosition();
        if (entity.getParent() != null) {
            np.setLevel(entity.getParent().getNodePosition().getLevel() + 1);
            if (!entity.getParent().getChildren().contains(entity)) {
                np.setOrder(entity.getParent().getChildren().size());
            }
        } else {
            np.setPosition(0, 0);
        }
    }
View Full Code Here

TOP

Related Classes of org.hibernate.examples.model.TreeNodePosition

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.