fri.util.database.jpa.tree
Interface TemporalTreeDao<N extends TreeNode>

Type Parameters:
N - the tree node type managed by this DAO.
All Superinterfaces:
TreeDao<N>
All Known Implementing Classes:
TemporalClosureTableTreeDao, TemporalNestedSetsTreeDao

public interface TemporalTreeDao<N extends TreeNode>
extends TreeDao<N>

Responsibilities of a temporal DAO extension. Provides means to read and recover historicized nodes, or remove them physically for cleanups.

The mechanism how nodes are historicized is hidden in the implementations of this interface (and thus can be overridden). The implementations provide the constructor parameters validFromPropertyName and validToPropertyName as default historization mechanism, assumed to be attributes that describe the validity period of a node (or path).

Author:
Fritz Ritzberger, 05.11.2012

Nested Class Summary
 
Nested classes/interfaces inherited from interface fri.util.database.jpa.tree.TreeDao
TreeDao.CopiedNodeRenamer<N extends TreeNode>
 
Field Summary
 
Fields inherited from interface fri.util.database.jpa.tree.TreeDao
UNDEFINED_POSITION
 
Method Summary
 java.util.List<N> findRemoved(N parent, java.util.Map<java.lang.String,java.lang.Object> criteria)
           
 java.util.List<N> findValidDirectChildren(java.util.List<N> treeCacheable)
          Use this to retrieve children lists that do not contain removed nodes from trees returned by getFullTreeCacheable().
 java.util.List<N> getAllRoots()
           
 java.util.List<N> getFullTreeCacheable(N parent)
           
 void removeAllPhysically()
          Physically deletes everything, all roots and the trees below them.
 void removeHistoricizedTreesPhysically()
          Physically deletes all historicized tree nodes in all roots, including their sub-nodes.
 void removePhysically(N node)
          Physically deletes the tree under given node, including the node itself.
 void unremove(N node)
          Recovers the given removed (historicized) node, including all sub-nodes.
 
Methods inherited from interface fri.util.database.jpa.tree.TreeDao
addChild, addChildAt, addChildBefore, checkUniqueConstraint, copy, copyBefore, copyTo, copyToBeRoot, createRoot, find, find, findDirectChildren, findSubTree, getChildCount, getChildren, getLevel, getParent, getPath, getRoot, getRoots, getTree, getTreeCacheable, isChildOf, isEqualToOrChildOf, isLeaf, isPersistent, isRoot, move, moveBefore, moveTo, moveToBeRoot, remove, removeAll, setCheckUniqueConstraintOnUpdate, setCopiedNodeRenamer, setUniqueTreeConstraint, size, update
 

Method Detail

findRemoved

java.util.List<N> findRemoved(N parent,
                              java.util.Map<java.lang.String,java.lang.Object> criteria)

getAllRoots

java.util.List<N> getAllRoots()
Returns:
all roots, including removed (historicized) ones.

getFullTreeCacheable

java.util.List<N> getFullTreeCacheable(N parent)
Returns:
the full tree under given parent, including removed (historicized) nodes.

findValidDirectChildren

java.util.List<N> findValidDirectChildren(java.util.List<N> treeCacheable)
Use this to retrieve children lists that do not contain removed nodes from trees returned by getFullTreeCacheable(). Use findDirectChildren() on a fullTreeCacheable to retrieve children lists that also contain removed nodes. The difference of both would be the removed children.

Parameters:
treeCacheable - the sub-tree to retrieve children from, containing parent at first position.
Returns:
the children list of the first node in given subNodes list, NOT containing removed nodes.

unremove

void unremove(N node)
Recovers the given removed (historicized) node, including all sub-nodes.


removePhysically

void removePhysically(N node)
Physically deletes the tree under given node, including the node itself. Node can also be a root.


removeHistoricizedTreesPhysically

void removeHistoricizedTreesPhysically()
Physically deletes all historicized tree nodes in all roots, including their sub-nodes.


removeAllPhysically

void removeAllPhysically()
Physically deletes everything, all roots and the trees below them.