fri.util.database.jpa.tree.nestedsets.uniqueconstraints
Class UniqueChildrenTemporalConstraintImpl

java.lang.Object
  extended by fri.util.database.jpa.tree.uniqueconstraints.AbstractUniqueTreeConstraintImpl<N>
      extended by fri.util.database.jpa.tree.uniqueconstraints.AbstractWholeTreeUniqueConstraintImpl<NestedSetsTreeNode>
          extended by fri.util.database.jpa.tree.nestedsets.uniqueconstraints.UniqueWholeTreeConstraintImpl
              extended by fri.util.database.jpa.tree.nestedsets.uniqueconstraints.UniqueWholeTreeTemporalConstraintImpl
                  extended by fri.util.database.jpa.tree.nestedsets.uniqueconstraints.UniqueChildrenTemporalConstraintImpl
All Implemented Interfaces:
UniqueTreeConstraint<NestedSetsTreeNode>

public class UniqueChildrenTemporalConstraintImpl
extends UniqueWholeTreeTemporalConstraintImpl

Author:
Fritz Ritzberger, 31.10.2012
See Also:
UniqueChildrenConstraintImpl

Field Summary
 
Fields inherited from class fri.util.database.jpa.tree.uniqueconstraints.AbstractUniqueTreeConstraintImpl
shouldCheckRootsForUniqueness, uniquePropertyNames
 
Constructor Summary
UniqueChildrenTemporalConstraintImpl(java.lang.String[][] uniquePropertyNames, boolean shouldCheckRootsForUniqueness)
           
 
Method Summary
 boolean checkUniqueConstraint(java.util.List<NestedSetsTreeNode> nodes, TreeActionLocation<NestedSetsTreeNode> location)
          The implementation of this is expected to check the uniqueness of passed node(s).
 
Methods inherited from class fri.util.database.jpa.tree.nestedsets.uniqueconstraints.UniqueWholeTreeTemporalConstraintImpl
beforeCheckUniqueness
 
Methods inherited from class fri.util.database.jpa.tree.nestedsets.uniqueconstraints.UniqueWholeTreeConstraintImpl
appendNodeCheckingCondition, appendRootCheckingCondition, fromClause, getNodeTableAlias
 
Methods inherited from class fri.util.database.jpa.tree.uniqueconstraints.AbstractUniqueTreeConstraintImpl
appendUniquenessConditions, appendUpdateCondition, checkUniqueChildrenConstraint, checkUniqueWholeTreeConstraint, equal, getDao, getNodeValueForProperty, getSession, isDifferent, isRootsCheck, nodeEntityName, pathEntityName, setContext
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

UniqueChildrenTemporalConstraintImpl

public UniqueChildrenTemporalConstraintImpl(java.lang.String[][] uniquePropertyNames,
                                            boolean shouldCheckRootsForUniqueness)
Method Detail

checkUniqueConstraint

public final boolean checkUniqueConstraint(java.util.List<NestedSetsTreeNode> nodes,
                                           TreeActionLocation<NestedSetsTreeNode> location)
The implementation of this is expected to check the uniqueness of passed node(s). Called by the DAO when addChild(), move() or copy() is performed. Mind that you must call treeDao.checkUniqueConstraint() explicitly when updating a node property, see explanation in header comment!.

Specified by:
checkUniqueConstraint in interface UniqueTreeConstraint<NestedSetsTreeNode>
Overrides:
checkUniqueConstraint in class AbstractWholeTreeUniqueConstraintImpl<NestedSetsTreeNode>
Parameters:
nodes - one (default) or more (copy/move only) entities that hold values to check for uniqueness at location, when list, the copied node will be first, then its sub-nodes.
location - the information where the pending modification is going to happen.
Returns:
false when unique constraint would be violated, else true.