com.anasoft.os.daofusion.criteria
Class AbstractCriterionGroup<T extends PersistentEntityCriterion<V>,V>

java.lang.Object
  extended by com.anasoft.os.daofusion.util.SimpleListContainer<T>
      extended by com.anasoft.os.daofusion.criteria.AbstractCriterionGroup<T,V>
Type Parameters:
T - Type of the criterion managed by the group.
V - Type of the criterion visitor applicable for managed criterion instances.
All Implemented Interfaces:
PersistentEntityCriteria
Direct Known Subclasses:
NestedPropertyCriteria

public abstract class AbstractCriterionGroup<T extends PersistentEntityCriterion<V>,V>
extends SimpleListContainer<T>
implements PersistentEntityCriteria

Base class for persistent entity criteria implementations working with PersistentEntityCriterion instances.

This class defines the contract for paging criteria (firstResult and maxResults) as well as its application to the target Criteria instance.

Author:
vojtech.szocs
See Also:
PersistentEntityCriterion, PersistentEntityCriteria, SimpleListContainer

Constructor Summary
AbstractCriterionGroup()
           
 
Method Summary
 void apply(org.hibernate.Criteria targetCriteria)
          Applies query constraints defined by the persistent entity criteria implementation to the targetCriteria.
protected  void applyPagingCriteria(org.hibernate.Criteria targetCriteria)
          Applies paging criteria to the targetCriteria.
protected abstract  V getCriterionVisitor(org.hibernate.Criteria targetCriteria)
          Returns the criterion visitor instance to be used within the apply(Criteria) method.
 java.lang.Integer getFirstResult()
           
 java.lang.Integer getMaxResults()
           
 void setFirstResult(java.lang.Integer firstResult)
           
 void setMaxResults(java.lang.Integer maxResults)
           
 
Methods inherited from class com.anasoft.os.daofusion.util.SimpleListContainer
add, clear, getObjectList
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AbstractCriterionGroup

public AbstractCriterionGroup()
Method Detail

getFirstResult

public java.lang.Integer getFirstResult()
Returns:
Index of the starting element or null representing no constraints on this paging parameter.

setFirstResult

public void setFirstResult(java.lang.Integer firstResult)
Parameters:
firstResult - Index of the starting element or null representing no constraints on this paging parameter.

getMaxResults

public java.lang.Integer getMaxResults()
Returns:
Maximum number of elements to return or null representing no constraints on this paging parameter.

setMaxResults

public void setMaxResults(java.lang.Integer maxResults)
Parameters:
maxResults - Maximum number of elements to return or null representing no constraints on this paging parameter.

applyPagingCriteria

protected void applyPagingCriteria(org.hibernate.Criteria targetCriteria)
Applies paging criteria to the targetCriteria.

Parameters:
targetCriteria - Criteria instance to update.

apply

public void apply(org.hibernate.Criteria targetCriteria)
Description copied from interface: PersistentEntityCriteria
Applies query constraints defined by the persistent entity criteria implementation to the targetCriteria.

Specified by:
apply in interface PersistentEntityCriteria
Parameters:
targetCriteria - Criteria instance to update.
See Also:
PersistentEntityCriteria.apply(org.hibernate.Criteria)

getCriterionVisitor

protected abstract V getCriterionVisitor(org.hibernate.Criteria targetCriteria)
Returns the criterion visitor instance to be used within the apply(Criteria) method.

Parameters:
targetCriteria - Root Criteria instance for visitor to work with.
Returns:
Criterion visitor instance operating on the targetCriteria.


Copyright © 2008-2009 ANASOFT and contributors. All Rights Reserved.