org.rhq.core.domain.criteria
Class Criteria

java.lang.Object
  extended by org.rhq.core.domain.criteria.Criteria
All Implemented Interfaces:
Serializable, BaseCriteria
Direct Known Subclasses:
AbstractConfigurationUpdateCriteria, AlertCriteria, AlertDefinitionCriteria, BundleFileCriteria, BundleResourceDeploymentCriteria, CallTimeDataCriteria, DashboardCriteria, DriftDefinitionCriteria, DriftDefinitionTemplateCriteria, EventCriteria, InstalledPackageCriteria, InstalledPackageHistoryCriteria, JPADriftChangeSetCriteria, JPADriftCriteria, MeasurementDataTraitCriteria, MeasurementDefinitionCriteria, MeasurementScheduleCriteria, OperationDefinitionCriteria, OperationHistoryCriteria, PackageCriteria, PackageVersionCriteria, RepoCriteria, ResourceGroupDefinitionCriteria, ResourceTypeCriteria, RoleCriteria, SavedSearchCriteria, SubjectCriteria, TagCriteria, TaggedCriteria

public abstract class Criteria
extends Object
implements Serializable, BaseCriteria

See Also:
Serialized Form

Nested Class Summary
static class Criteria.NonBindingOverrideFilter
          This is the type of a filter value when the override for that filter does not define any query parameter.
static class Criteria.Restriction
          Apply a restriction to reduce the cost of the Criteria-based query generation and execution routines.
static class Criteria.Type
           
 
Field Summary
protected  Map<String,String> filterOverrides
           
protected  PageControl pageControlOverrides
           
protected  Map<String,String> sortOverrides
           
 
Constructor Summary
Criteria()
           
 
Method Summary
 void addRequiredPermissions(Permission... requiredPermissions)
           
protected  void addSortField(String fieldName)
           
 void clearPaging()
           
 String getAlias()
           
 String getJPQLFilterOverride(String fieldName)
           
 String getJPQLSortOverride(String fieldName)
           
 List<String> getOrderingFieldNames()
           
 PageControl getPageControlOverrides()
           
 Integer getPageNumber()
           
 Integer getPageSize()
           
abstract  Class<?> getPersistentClass()
           
 List<Permission> getRequiredPermissions()
           
 Criteria.Restriction getRestriction()
           
 String getSearchExpression()
           
 boolean hasCustomizedSorting()
          By default, the ordering fields are automatically prepend with the alias of entity that this criteria object wraps.
 boolean isCaseSensitive()
           
 boolean isFiltersOptional()
           
 boolean isInventoryManagerRequired()
          subclasses should override as necessary
 boolean isSecurityManagerRequired()
          subclasses should override as necessary
 boolean isStrict()
           
 void setCaseSensitive(boolean caseSensitive)
          If set to true, string-based filters will use case-sensitive matching; Default is 'false', which means results will match case-insensitively
 void setFiltersOptional(boolean filtersOptional)
          If set to true, then results will come back if they match ANY filter; Default is 'false', which means results must match all set filters.
 void setPageControl(PageControl pageControl)
          If the pageControl is set, then this criteria object will completely ignore any calls made to setPaging(pageNumber, pageSize) as well as addSortField(fieldName), which is useful from a server-side calling context where the PageControl object will already have been created for you by the extensions at the JSF layer.
 void setPaging(int pageNumber, int pageSize)
           
 void setRestriction(Criteria.Restriction restriction)
          By default, two queries will be generated for this Criteria: one which fetches the requested page/subset of entity results, and one which fetches the total cardinality of the result set.
 void setSearchExpression(String searchExpression)
           
 void setStrict(boolean strict)
          If set to true, string-based filters will use exact string matches; Default is 'false', which means we'll fuzzy match
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

filterOverrides

protected Map<String,String> filterOverrides

sortOverrides

protected Map<String,String> sortOverrides

pageControlOverrides

protected PageControl pageControlOverrides
Constructor Detail

Criteria

public Criteria()
Method Detail

getPersistentClass

public abstract Class<?> getPersistentClass()

getPageNumber

public Integer getPageNumber()

getPageSize

public Integer getPageSize()

getOrderingFieldNames

public List<String> getOrderingFieldNames()

getJPQLFilterOverride

public String getJPQLFilterOverride(String fieldName)

getJPQLSortOverride

public String getJPQLSortOverride(String fieldName)

getPageControlOverrides

public PageControl getPageControlOverrides()
Specified by:
getPageControlOverrides in interface BaseCriteria

addSortField

protected void addSortField(String fieldName)

setPaging

public void setPaging(int pageNumber,
                      int pageSize)

setPageControl

public void setPageControl(PageControl pageControl)
If the pageControl is set, then this criteria object will completely ignore any calls made to setPaging(pageNumber, pageSize) as well as addSortField(fieldName), which is useful from a server-side calling context where the PageControl object will already have been created for you by the extensions at the JSF layer.

Specified by:
setPageControl in interface BaseCriteria

hasCustomizedSorting

public boolean hasCustomizedSorting()
By default, the ordering fields are automatically prepend with the alias of entity that this criteria object wraps. However, some authors of criteria objects want full control of this alias during sort operations. if this method returns true, then the alias will not be prepend to the generated "order by" clause, which makes author responsible for constructing the fully-qualified ordering token for each sort override.


clearPaging

public void clearPaging()

setFiltersOptional

public void setFiltersOptional(boolean filtersOptional)
If set to true, then results will come back if they match ANY filter; Default is 'false', which means results must match all set filters.


isFiltersOptional

public boolean isFiltersOptional()

setCaseSensitive

public void setCaseSensitive(boolean caseSensitive)
If set to true, string-based filters will use case-sensitive matching; Default is 'false', which means results will match case-insensitively


isCaseSensitive

public boolean isCaseSensitive()

setStrict

public void setStrict(boolean strict)
If set to true, string-based filters will use exact string matches; Default is 'false', which means we'll fuzzy match

Specified by:
setStrict in interface BaseCriteria

isStrict

public boolean isStrict()
Specified by:
isStrict in interface BaseCriteria

setRestriction

public void setRestriction(Criteria.Restriction restriction)
By default, two queries will be generated for this Criteria: one which fetches the requested page/subset of entity results, and one which fetches the total cardinality of the result set. If you wish to only retrieve one of those pieces of data, you can do so by setting a restriction on the query generation and execution routines. The restriction, once set, can be removed by passing NULL to this method.

See Also:
Criteria.Restriction

getRestriction

public Criteria.Restriction getRestriction()

setSearchExpression

public void setSearchExpression(String searchExpression)

getSearchExpression

public String getSearchExpression()

isInventoryManagerRequired

public boolean isInventoryManagerRequired()
subclasses should override as necessary


isSecurityManagerRequired

public boolean isSecurityManagerRequired()
subclasses should override as necessary


getRequiredPermissions

public List<Permission> getRequiredPermissions()
Returns:
the permissions required by the user on any applicable objects. Typically resource permissions needed by the user on returned resources or resource related data.

addRequiredPermissions

public void addRequiredPermissions(Permission... requiredPermissions)
Parameters:
requiredPermissions - the permissions required by the user on any applicable objects. Typically resource permissions needed by the user on returned resources or resource related data.

getAlias

public String getAlias()


Copyright © 2008-2011 Red Hat, Inc.. All Rights Reserved.