Package sk.iway.iwcm.database.nestedsets
Interface NestedSetManager
- All Known Implementing Classes:
JpaNestedSetManager
public interface NestedSetManager
A NestedSetManager is used to read and manipulate the nested set tree structure of
classes that implement
NodeInfo
using and where each instance thus has a position in a
nested set tree.-
Method Summary
Modifier and TypeMethodDescriptionvoid
clear()
Clears the NestedSetManager, removing all managed nodes from the NestedSetManager.createRoot
(T root) Creates a root node for the given NodeInfo instance.fetchTree
(Class<T> clazz, org.eclipse.persistence.expressions.Expression filtrationCriteria, T parent) Fetches the complete tree, returning the root node of the tree.fetchTree
(Class<T> clazz, org.eclipse.persistence.expressions.Expression filtrationCriteria, T parent, int rootId) Fetches a complete tree, returning the root node of the tree.fetchTreeAsList
(Class<T> clazz, org.eclipse.persistence.expressions.Expression filtrationCriteria, T parent) Fetches a complete tree and returns the tree as a list.fetchTreeAsList
(Class<T> clazz, org.eclipse.persistence.expressions.Expression filtrationCriteria, T parent, int rootId) Fetches a complete tree and returns the tree as a list.javax.persistence.EntityManager
Gets the EntityManager used by this NestedSetManager.getNode
(T nodeInfo) Gets the node that represents the given NodeInfo instance in the tree.Collection<Node<?>>
getNodes()
Gets a collection of all nodes currently managed by the NestedSetManager.<T extends NodeInfo>
void<T extends NodeInfo>
voidupdate
(T nodeInfo)
-
Method Details
-
clear
void clear()Clears the NestedSetManager, removing all managed nodes from the NestedSetManager. Any entities wrapped by such nodes are not detached from the underlying EntityManager. -
createRoot
Creates a root node for the given NodeInfo instance.- Type Parameters:
T
-- Parameters:
root
-- Returns:
- The created node instance.
-
fetchTree
<T extends NodeInfo> Node<T> fetchTree(Class<T> clazz, org.eclipse.persistence.expressions.Expression filtrationCriteria, T parent, int rootId) Fetches a complete tree, returning the root node of the tree.- Type Parameters:
T
-- Parameters:
clazz
-rootId
-- Returns:
- The root node of the tree.
-
fetchTree
<T extends NodeInfo> Node<T> fetchTree(Class<T> clazz, org.eclipse.persistence.expressions.Expression filtrationCriteria, T parent) Fetches the complete tree, returning the root node of the tree.- Type Parameters:
T
-- Parameters:
clazz
-filtrationCriteria
-parent
-- Returns:
- The root node of the tree.
-
fetchTreeAsList
<T extends NodeInfo> List<Node<T>> fetchTreeAsList(Class<T> clazz, org.eclipse.persistence.expressions.Expression filtrationCriteria, T parent) Fetches a complete tree and returns the tree as a list.- Type Parameters:
T
-- Parameters:
clazz
-- Returns:
- The tree in form of a list, starting with the root node.
-
fetchTreeAsList
<T extends NodeInfo> List<Node<T>> fetchTreeAsList(Class<T> clazz, org.eclipse.persistence.expressions.Expression filtrationCriteria, T parent, int rootId) Fetches a complete tree and returns the tree as a list.- Type Parameters:
T
-- Parameters:
clazz
-rootId
-- Returns:
- The tree in form of a list, starting with the root node.
-
getEntityManager
javax.persistence.EntityManager getEntityManager()Gets the EntityManager used by this NestedSetManager.- Returns:
- The EntityManager.
-
getNode
Gets the node that represents the given NodeInfo instance in the tree.- Type Parameters:
T
-- Parameters:
nodeInfo
-- Returns:
- The node.
-
getNodes
Collection<Node<?>> getNodes()Gets a collection of all nodes currently managed by the NestedSetManager.- Returns:
- The collection of nodes.
-
update
-
update
-
getConfig
-