com.anasoft.os.daofusion.cto.server
Class FilterAndSortMapping<T>

java.lang.Object
  extended by com.anasoft.os.daofusion.cto.server.NestedPropertyMapping
      extended by com.anasoft.os.daofusion.cto.server.FilterAndSortMapping<T>
Type Parameters:
T - Type of filter values the underlying FilterCriterionProvider works with.

public class FilterAndSortMapping<T>
extends NestedPropertyMapping

Criteria transfer object mapping regarding the filtering and sorting functionality.

This mapping uses a FilterValueConverter to convert string-based filter values received from the FilterAndSortCriteria into their typed object representations (resulting objects will be passed as directValues to the underlying FilterCriterion instances in case the filterCriterionProvider is not null).

Note that the filtering functionality can be disabled by setting filterCriterionProvider to null.

Author:
vojtech.szocs
See Also:
FilterCriterionProvider, FilterValueConverter, NestedPropertyMapping

Constructor Summary
FilterAndSortMapping(java.lang.String propertyId, AssociationPath associationPath, java.lang.String targetPropertyName)
          Creates a new property mapping.
FilterAndSortMapping(java.lang.String propertyId, AssociationPath associationPath, java.lang.String targetPropertyName, FilterCriterionProvider filterCriterionProvider, FilterValueConverter<T> filterValueConverter)
          Creates a new property mapping.
FilterAndSortMapping(java.lang.String propertyId, java.lang.String propertyPath)
          Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.
FilterAndSortMapping(java.lang.String propertyId, java.lang.String propertyPath, FilterCriterionProvider filterCriterionProvider, FilterValueConverter<T> filterValueConverter)
          Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.
FilterAndSortMapping(java.lang.String propertyId, java.lang.String propertyPath, NestedPropertyJoinType associationJoinType)
          Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.
FilterAndSortMapping(java.lang.String propertyId, java.lang.String propertyPath, NestedPropertyJoinType associationJoinType, FilterCriterionProvider filterCriterionProvider, FilterValueConverter<T> filterValueConverter)
          Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.
 
Method Summary
 void apply(FilterAndSortCriteria clientSideCriteria, NestedPropertyCriteria serverSideCriteria)
          Applies query constraints defined by the clientSideCriteria to the serverSideCriteria according to the property mapping implementation.
 FilterCriterionProvider getFilterCriterionProvider()
           
 FilterValueConverter<T> getFilterValueConverter()
           
 
Methods inherited from class com.anasoft.os.daofusion.cto.server.NestedPropertyMapping
getAssociationPath, getPropertyId, getTargetPropertyName
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FilterAndSortMapping

@Deprecated
public FilterAndSortMapping(java.lang.String propertyId,
                                       java.lang.String propertyPath,
                                       NestedPropertyJoinType associationJoinType,
                                       FilterCriterionProvider filterCriterionProvider,
                                       FilterValueConverter<T> filterValueConverter)
Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.

Creates a new property mapping.

Parameters:
propertyId - Symbolic persistent entity property identifier.
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).
filterCriterionProvider - Criterion instance provider used for filtering or null to disable the filtering functionality.
filterValueConverter - FilterValueConverter implementation applicable to corresponding filter values (effective only only when the filterCriterionProvider is not null).

FilterAndSortMapping

public FilterAndSortMapping(java.lang.String propertyId,
                            AssociationPath associationPath,
                            java.lang.String targetPropertyName,
                            FilterCriterionProvider filterCriterionProvider,
                            FilterValueConverter<T> filterValueConverter)
Creates a new property mapping.

Parameters:
propertyId - Symbolic persistent entity property identifier.
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 or null to disable the filtering functionality.
filterValueConverter - FilterValueConverter implementation applicable to corresponding filter values (effective only only when the filterCriterionProvider is not null).

FilterAndSortMapping

@Deprecated
public FilterAndSortMapping(java.lang.String propertyId,
                                       java.lang.String propertyPath,
                                       FilterCriterionProvider filterCriterionProvider,
                                       FilterValueConverter<T> filterValueConverter)
Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.

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

Parameters:
propertyId - Symbolic persistent entity property identifier.
propertyPath - Dot-separated logical path to the target property.
filterCriterionProvider - Criterion instance provider used for filtering or null to disable the filtering functionality.
filterValueConverter - FilterValueConverter implementation applicable to corresponding filter values (effective only only when the filterCriterionProvider is not null).

FilterAndSortMapping

@Deprecated
public FilterAndSortMapping(java.lang.String propertyId,
                                       java.lang.String propertyPath,
                                       NestedPropertyJoinType associationJoinType)
Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.

Creates a new property mapping.

This is a convenience constructor for mappings which don't require the filtering functionality.

Parameters:
propertyId - Symbolic persistent entity property identifier.
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).

FilterAndSortMapping

public FilterAndSortMapping(java.lang.String propertyId,
                            AssociationPath associationPath,
                            java.lang.String targetPropertyName)
Creates a new property mapping.

This is a convenience constructor for mappings which don't require the filtering functionality.

Parameters:
propertyId - Symbolic persistent entity property identifier.
associationPath - AssociationPath which points to the given property of the target persistent entity.
targetPropertyName - Name of the target property of the given persistent entity.

FilterAndSortMapping

@Deprecated
public FilterAndSortMapping(java.lang.String propertyId,
                                       java.lang.String propertyPath)
Deprecated. propertyPath / associationJoinType concept is now deprecated in favor of the associationPath / targetPropertyName approach.

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

This is a convenience constructor for mappings which don't require the filtering functionality.

Parameters:
propertyId - Symbolic persistent entity property identifier.
propertyPath - Dot-separated logical path to the target property.
Method Detail

getFilterCriterionProvider

public FilterCriterionProvider getFilterCriterionProvider()
Returns:
Criterion instance provider used for filtering or null to disable the filtering functionality.

getFilterValueConverter

public FilterValueConverter<T> getFilterValueConverter()
Returns:
FilterValueConverter implementation applicable to corresponding filter values (effective only only when the filterCriterionProvider is not null).

apply

public void apply(FilterAndSortCriteria clientSideCriteria,
                  NestedPropertyCriteria serverSideCriteria)
Description copied from class: NestedPropertyMapping
Applies query constraints defined by the clientSideCriteria to the serverSideCriteria according to the property mapping implementation.

Specified by:
apply in class NestedPropertyMapping
Parameters:
clientSideCriteria - Client-side persistent entity criteria representation.
serverSideCriteria - NestedPropertyCriteria instance to update.
See Also:
NestedPropertyMapping.apply(com.anasoft.os.daofusion.cto.client.FilterAndSortCriteria, com.anasoft.os.daofusion.criteria.NestedPropertyCriteria)


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