com.anasoft.os.daofusion.cto.server
Class CriteriaTransferObjectCountWrapper

java.lang.Object
  extended by com.anasoft.os.daofusion.cto.server.CriteriaTransferObjectCountWrapper

public class CriteriaTransferObjectCountWrapper
extends java.lang.Object

Server-side CriteriaTransferObject wrapper for entity instance count purposes.

Use this class to wrap CriteriaTransferObject instances which should suppress paging and sort constraints in conjunction with entity instance count methods defined by the PersistentEntityDao.

Author:
vojtech.szocs, igor.mihalik
See Also:
CriteriaTransferObject, PersistentEntityDao

Constructor Summary
CriteriaTransferObjectCountWrapper(CriteriaTransferObject transferObject)
          Creates a new CriteriaTransferObject wrapper.
 
Method Summary
 CriteriaTransferObject wrap()
          Returns a CriteriaTransferObject instance suitable for entity instance count methods defined by the PersistentEntityDao.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CriteriaTransferObjectCountWrapper

public CriteriaTransferObjectCountWrapper(CriteriaTransferObject transferObject)
Creates a new CriteriaTransferObject wrapper.

Parameters:
transferObject - CriteriaTransferObject instance to wrap.
Method Detail

wrap

public CriteriaTransferObject wrap()
Returns a CriteriaTransferObject instance suitable for entity instance count methods defined by the PersistentEntityDao.

Resulting transfer object delegates most of its methods to the wrapped CriteriaTransferObject instance with the exception of paging and sort constraints and methods that modify internal state of the transfer object.

Use this method after receiving the original CriteriaTransferObject instance from the client prior to conversion, for example:

 PersistentEntityCriteria countCriteria = converter.convert(
     new CriteriaTransferObjectCountWrapper(transferObject).wrap(),
     myMappingGroup);
 
 int totalRecords = myDao.count(countCriteria);
 

Returns:
CriteriaTransferObject instance suitable for entity instance count methods.


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