Holger's
Java API

com.antelmann.sql
Class TopicMapFilter<T>

java.lang.Object
  extended by com.antelmann.sql.TopicMapFilter<T>
All Implemented Interfaces:
CascadingFilter<T>, Filter<T>, Serializable

public class TopicMapFilter<T>
extends Object
implements CascadingFilter<T>, Serializable

a special filter that works very similar to an SQLMapFilter, but one instance can be applied to different stores with different mappings - based on the topics. Its embedded map is automatically translated via MappingInfo.getMappingForTopic(Object) by a BaseRowMapper. Note that if a given topic is not supported by the mapper itself, that restriction simply doesn't apply.

Author:
Holger Antelmann
See Also:
MappingInfo.getMappingForTopic(Object), BaseRowMapper, SQLMapFilter, Serialized Form

Field Summary
 
Fields inherited from interface com.antelmann.util.Filter
EXCLUDE_ALL_FILTER, INCLUDE_ALL_FILTER
 
Constructor Summary
TopicMapFilter()
           
TopicMapFilter(Map<Object,Object> sqlFilterMap, Filter<? super T> internalFilter, Object... orderByColumns)
          if a column is to be sorted descending, put a minus sign before the column name
TopicMapFilter(Map<Object,Object> sqlFilterMap, Object... orderByColumns)
          if a column is to be sorted descending, put a minus sign before the column name
TopicMapFilter(Object key, Object value)
           
TopicMapFilter(Object key, Object value, Object... orderByColumns)
           
 
Method Summary
 boolean accept(T entry)
          return value based on the internal filter - or returns null if the internal filter is null
 SQLMapFilter<T> convertTopicFilter(DBClassStore<?> store)
           
 SQLMapFilter<T> convertTopicFilter(MappingInfo mapping)
           
 Filter<? super T> getInnerFilter()
          returns the internal filter that applies in this instance's accept() method
 Object[] getOrder()
           
 Map<Object,Object> getSQLFilterMap()
          gives direct access to the embedded map, which may be null if constructed directly with a query String
 boolean isCombineWithAnd()
          true by default
 boolean isIgnoreInvalidTopics()
           
 void setCombineWithAnd(boolean flag)
           
 void setIgnoreInvalidTopics(boolean ignoreInvalidTopics)
           
 void setInnerFilter(Filter<? super T> internalFilter)
           
 void setOrder(Object... orderByColumns)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TopicMapFilter

public TopicMapFilter()

TopicMapFilter

public TopicMapFilter(Object key,
                      Object value)

TopicMapFilter

public TopicMapFilter(Object key,
                      Object value,
                      Object... orderByColumns)

TopicMapFilter

public TopicMapFilter(Map<Object,Object> sqlFilterMap,
                      Object... orderByColumns)
if a column is to be sorted descending, put a minus sign before the column name


TopicMapFilter

public TopicMapFilter(Map<Object,Object> sqlFilterMap,
                      Filter<? super T> internalFilter,
                      Object... orderByColumns)
if a column is to be sorted descending, put a minus sign before the column name

Method Detail

getSQLFilterMap

public Map<Object,Object> getSQLFilterMap()
gives direct access to the embedded map, which may be null if constructed directly with a query String


setInnerFilter

public void setInnerFilter(Filter<? super T> internalFilter)
Specified by:
setInnerFilter in interface CascadingFilter<T>

getInnerFilter

public Filter<? super T> getInnerFilter()
returns the internal filter that applies in this instance's accept() method

Specified by:
getInnerFilter in interface CascadingFilter<T>

getOrder

public Object[] getOrder()

setOrder

public void setOrder(Object... orderByColumns)

isCombineWithAnd

public boolean isCombineWithAnd()
true by default


setCombineWithAnd

public void setCombineWithAnd(boolean flag)

accept

public boolean accept(T entry)
return value based on the internal filter - or returns null if the internal filter is null

Specified by:
accept in interface Filter<T>

isIgnoreInvalidTopics

public boolean isIgnoreInvalidTopics()

setIgnoreInvalidTopics

public void setIgnoreInvalidTopics(boolean ignoreInvalidTopics)

convertTopicFilter

public SQLMapFilter<T> convertTopicFilter(DBClassStore<?> store)

convertTopicFilter

public SQLMapFilter<T> convertTopicFilter(MappingInfo mapping)


(c) Holger Antelmann since 2001- all rights reserved (contact: info@antelmann.com)
see www.antelmann.com/developer for further details and available downloads