com.anasoft.os.daofusion.cto.client
Class CriteriaTransferObject

java.lang.Object
  extended by com.anasoft.os.daofusion.cto.client.CriteriaTransferObject
All Implemented Interfaces:
java.io.Serializable

public class CriteriaTransferObject
extends java.lang.Object
implements java.io.Serializable

Generic persistent entity criteria transfer object used by the CriteriaTransferObjectConverter.

Criteria transfer object pattern allows client-side components to construct serializable versions of PersistentEntityCriteria instances, which can then be passed through the chosen communication mechanism to the remote (server-side) component. This way, the user can create persistent entity criteria on the client side and use CriteriaTransferObjectConverter to transform them into corresponding PersistentEntityCriteria instances seamlessly on the server.

This class essentially acts as map-based container for FilterAndSortCriteria instances, defining basic entity criteria for target entity properties on the client.

Author:
vojtech.szocs
See Also:
FilterAndSortCriteria, CriteriaTransferObjectConverter, PersistentEntityCriteria, Serialized Form

Constructor Summary
CriteriaTransferObject()
           
 
Method Summary
 void add(FilterAndSortCriteria criteria)
          Adds the given FilterAndSortCriteria instance to this transfer object.
 FilterAndSortCriteria get(java.lang.String propertyId)
          Returns a FilterAndSortCriteria instance with the given propertyId.
 java.lang.Integer getFirstResult()
           
 java.lang.Integer getMaxResults()
           
 java.util.Set<java.lang.String> getPropertyIdSet()
          Returns a set of symbolic persistent entity property identifiers (propertyId values) for FilterAndSortCriteria instances contained within this transfer object.
 void setFirstResult(java.lang.Integer firstResult)
           
 void setMaxResults(java.lang.Integer maxResults)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

CriteriaTransferObject

public CriteriaTransferObject()
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.

add

public void add(FilterAndSortCriteria criteria)
Adds the given FilterAndSortCriteria instance to this transfer object.

Note that the propertyId of the given FilterAndSortCriteria instance must be unique within the transfer object (in other words, existing FilterAndSortCriteria with same propertyId will be replaced by this method).

Parameters:
criteria - FilterAndSortCriteria instance to add.

get

public FilterAndSortCriteria get(java.lang.String propertyId)
Returns a FilterAndSortCriteria instance with the given propertyId.

When not found, the method creates and adds an empty FilterAndSortCriteria instance to the transfer object automatically.

Parameters:
propertyId - Symbolic persistent entity property identifier.
Returns:
FilterAndSortCriteria instance with the given propertyId.

getPropertyIdSet

public java.util.Set<java.lang.String> getPropertyIdSet()
Returns a set of symbolic persistent entity property identifiers (propertyId values) for FilterAndSortCriteria instances contained within this transfer object.

Returns:
Set of symbolic persistent entity property identifiers (propertyId values).


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