com.anasoft.os.daofusion.criteria
Class FilterCriterion

java.lang.Object
  extended by com.anasoft.os.daofusion.criteria.NestedPropertyCriterion<NestedPropertyCriterionVisitor>
      extended by com.anasoft.os.daofusion.criteria.FilterCriterion
All Implemented Interfaces:
PersistentEntityCriterion<NestedPropertyCriterionVisitor>

public class FilterCriterion
extends NestedPropertyCriterion<NestedPropertyCriterionVisitor>

Filter criterion for a single property of the target persistent entity.

The filter criterion uses the FilterCriterionProvider to construct a Criterion instance corresponding to the given property of the target persistent entity.

There are basically two ways to pass filter data to FilterCriterionProvider (both of which are optional):

This makes it possible to combine both filter data concepts together to suit individual filter criterion needs.

Author:
vojtech.szocs
See Also:
FilterCriterionProvider, SimpleFilterCriterionProvider, NestedPropertyCriterion

Nested Class Summary
static class FilterCriterion.FilterCriterionBuilder
          Builder for FilterCriterion instances.
 
Nested classes/interfaces inherited from class com.anasoft.os.daofusion.criteria.NestedPropertyCriterion
NestedPropertyCriterion.NestedPropertyCriterionBuilder<T extends NestedPropertyCriterion<V>,V extends NestedPropertyCriterionVisitor>
 
Constructor Summary
FilterCriterion(AssociationPath associationPath, java.lang.String targetPropertyName, FilterCriterionProvider filterCriterionProvider)
          Creates a new filter criterion.
FilterCriterion(AssociationPath associationPath, java.lang.String targetPropertyName, java.lang.Object value, boolean useFilterObjectPathResolution, FilterCriterionProvider filterCriterionProvider)
          Creates a new filter criterion.
FilterCriterion(AssociationPath associationPath, java.lang.String targetPropertyName, java.lang.String[] filterObjectValuePaths, java.lang.Object[] directValues, FilterCriterionProvider filterCriterionProvider)
          Creates a new filter criterion.
FilterCriterion(java.lang.String propertyPath, NestedPropertyJoinType associationJoinType, java.lang.Object value, boolean useFilterObjectPathResolution, FilterCriterionProvider filterCriterionProvider)
          Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.
FilterCriterion(java.lang.String propertyPath, NestedPropertyJoinType associationJoinType, java.lang.String[] filterObjectValuePaths, java.lang.Object[] directValues, FilterCriterionProvider filterCriterionProvider)
          Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.
FilterCriterion(java.lang.String propertyPath, java.lang.Object value, boolean useFilterObjectPathResolution, FilterCriterionProvider filterCriterionProvider)
          Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.
FilterCriterion(java.lang.String propertyPath, java.lang.String[] filterObjectValuePaths, java.lang.Object[] directValues, FilterCriterionProvider filterCriterionProvider)
          Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.
 
Method Summary
 void accept(NestedPropertyCriterionVisitor visitor)
          Accepts the given visitor to visit this criterion.
 java.lang.Object[] getDirectValues()
           
 FilterCriterionProvider getFilterCriterionProvider()
           
 java.lang.String[] getFilterObjectValuePaths()
           
 
Methods inherited from class com.anasoft.os.daofusion.criteria.NestedPropertyCriterion
equals, getAssociationPath, getTargetPropertyName, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

FilterCriterion

@Deprecated
public FilterCriterion(java.lang.String propertyPath,
                                  NestedPropertyJoinType associationJoinType,
                                  java.lang.String[] filterObjectValuePaths,
                                  java.lang.Object[] directValues,
                                  FilterCriterionProvider filterCriterionProvider)
Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.

Creates a new filter criterion.

Parameters:
propertyPath - Dot-separated logical path to the target property.
associationJoinType - Type of join to use in case of a nested (non-direct) persistent entity property (can be null otherwise).
filterObjectValuePaths - Array of dot-separated logical paths pointing to values reachable from the root filter object (can be null).
directValues - Array of filter values provided directly by the user (can be null).
filterCriterionProvider - Criterion instance provider used for filtering.

FilterCriterion

public FilterCriterion(AssociationPath associationPath,
                       java.lang.String targetPropertyName,
                       java.lang.String[] filterObjectValuePaths,
                       java.lang.Object[] directValues,
                       FilterCriterionProvider filterCriterionProvider)
Creates a new filter criterion.

Parameters:
associationPath - AssociationPath which points to the given property of the target persistent entity.
targetPropertyName - Name of the target property of the given persistent entity.
filterObjectValuePaths - Array of dot-separated logical paths pointing to values reachable from the root filter object (can be null).
directValues - Array of filter values provided directly by the user (can be null).
filterCriterionProvider - Criterion instance provider used for filtering.

FilterCriterion

@Deprecated
public FilterCriterion(java.lang.String propertyPath,
                                  java.lang.String[] filterObjectValuePaths,
                                  java.lang.Object[] directValues,
                                  FilterCriterionProvider filterCriterionProvider)
Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.

Creates a new filter criterion using the default nested persistent entity property join type.

Parameters:
propertyPath - Dot-separated logical path to the target property.
filterObjectValuePaths - Array of dot-separated logical paths pointing to values reachable from the root filter object (can be null).
directValues - Array of filter values provided directly by the user (can be null).
filterCriterionProvider - Criterion instance provider used for filtering.

FilterCriterion

@Deprecated
public FilterCriterion(java.lang.String propertyPath,
                                  NestedPropertyJoinType associationJoinType,
                                  java.lang.Object value,
                                  boolean useFilterObjectPathResolution,
                                  FilterCriterionProvider filterCriterionProvider)
Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.

Creates a new filter criterion.

This is a convenience constructor supporting single filter object value path or a single direct value, depending on useFilterObjectPathResolution.

Parameters:
propertyPath - Dot-separated logical path to the target property.
associationJoinType - Type of join to use in case of a nested (non-direct) persistent entity property (can be null otherwise).
value - Dot-separated logical path pointing to a value reachable from the root filter object OR a direct value provided by the user.
useFilterObjectPathResolution - true to treat value as a filter object value path, false to treat value as a direct value provided by the user.
filterCriterionProvider - Criterion instance provider used for filtering.

FilterCriterion

public FilterCriterion(AssociationPath associationPath,
                       java.lang.String targetPropertyName,
                       java.lang.Object value,
                       boolean useFilterObjectPathResolution,
                       FilterCriterionProvider filterCriterionProvider)
Creates a new filter criterion.

This is a convenience constructor supporting single filter object value path or a single direct value, depending on useFilterObjectPathResolution.

Parameters:
associationPath - AssociationPath which points to the given property of the target persistent entity.
targetPropertyName - Name of the target property of the given persistent entity.
value - Dot-separated logical path pointing to a value reachable from the root filter object OR a direct value provided by the user.
useFilterObjectPathResolution - true to treat value as a filter object value path, false to treat value as a direct value provided by the user.
filterCriterionProvider - Criterion instance provider used for filtering.

FilterCriterion

public FilterCriterion(AssociationPath associationPath,
                       java.lang.String targetPropertyName,
                       FilterCriterionProvider filterCriterionProvider)
Creates a new filter criterion.

This is a convenience constructor for bypassing filter data definition (FilterCriterionProvider will have to specify Criterion filter data on its own).

Parameters:
associationPath - AssociationPath which points to the given property of the target persistent entity.
targetPropertyName - Name of the target property of the given persistent entity.
filterCriterionProvider - Criterion instance provider used for filtering.

FilterCriterion

@Deprecated
public FilterCriterion(java.lang.String propertyPath,
                                  java.lang.Object value,
                                  boolean useFilterObjectPathResolution,
                                  FilterCriterionProvider filterCriterionProvider)
Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.

Creates a new filter criterion using the default nested persistent entity property join type.

This is a convenience constructor supporting single filter object value path or a single direct value, depending on useFilterObjectPathResolution.

Parameters:
propertyPath - Dot-separated logical path to the target property.
value - Dot-separated logical path pointing to a value reachable from the root filter object OR a direct value provided by the user.
useFilterObjectPathResolution - true to treat value as a filter object value path, false to treat value as a direct value provided by the user.
filterCriterionProvider - Criterion instance provider used for filtering.
Method Detail

getFilterObjectValuePaths

public java.lang.String[] getFilterObjectValuePaths()
Returns:
Array of dot-separated logical paths pointing to values reachable from the root filter object (can be null).

getDirectValues

public java.lang.Object[] getDirectValues()
Returns:
Array of filter values provided directly by the user (can be null).

getFilterCriterionProvider

public FilterCriterionProvider getFilterCriterionProvider()
Returns:
Criterion instance provider used for filtering.

accept

public void accept(NestedPropertyCriterionVisitor visitor)
Description copied from interface: PersistentEntityCriterion
Accepts the given visitor to visit this criterion.

Parameters:
visitor - The visitor to accept.
See Also:
PersistentEntityCriterion.accept(java.lang.Object)


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