Holger's
Java API

com.antelmann.sql
Class SQLStubFilter

java.lang.Object
  extended by com.antelmann.sql.SQLStubFilter
All Implemented Interfaces:
CascadingFilter<Stub<?>>, Filter<Stub<?>>, Serializable

public class SQLStubFilter
extends Object
implements CascadingFilter<Stub<?>>, Serializable

a special filter that can be used to easily pre-filter Stubs via restrictions used in a ConnectionHelper (to fetch them from a DBClassStore).

Since:
12. Dezember 2006, 16:43
Author:
Holger Antelmann
See Also:
JDBCRowStore, Stub, ConnectionHelper.filterTable(String, Map), PropertyEntryFilter, SQLMapFilter, Serialized Form

Field Summary
 
Fields inherited from interface com.antelmann.util.Filter
EXCLUDE_ALL_FILTER, INCLUDE_ALL_FILTER
 
Constructor Summary
SQLStubFilter()
           
SQLStubFilter(Map<String,Object> sqlFilter, Filter<Stub<?>> internalFilter, String... orderByColumns)
           
SQLStubFilter(Map<String,Object> sqlFilter, String... orderByColumns)
           
SQLStubFilter(SQLMapFilter<?> filter)
          Note that the filter constructed this way may only used for stubs of the original type - which remains unchecked here
SQLStubFilter(String key, Object value, String... orderByColumns)
           
 
Method Summary
 boolean accept(Stub<?> stub)
          always returns true; useful filtering only applies for the SQL-selection
 Filter<? super Stub<?>> getInnerFilter()
           
 String[] getOrder()
           
 Map<String,Object> getSQLFilter()
          gives direct access to the embedded map
 boolean isCombineWithAnd()
          true by default
 void setCombineWithAnd(boolean flag)
           
 void setInnerFilter(Filter<? super Stub<?>> internalFilter)
           
 void setOrder(String... orderByColumns)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SQLStubFilter

public SQLStubFilter(SQLMapFilter<?> filter)
              throws IllegalArgumentException
Note that the filter constructed this way may only used for stubs of the original type - which remains unchecked here

Throws:
IllegalArgumentException - if the given filter contains an inner filter
See Also:
SQLMapFilter.getInnerFilter()

SQLStubFilter

public SQLStubFilter()

SQLStubFilter

public SQLStubFilter(String key,
                     Object value,
                     String... orderByColumns)

SQLStubFilter

public SQLStubFilter(Map<String,Object> sqlFilter,
                     String... orderByColumns)

SQLStubFilter

public SQLStubFilter(Map<String,Object> sqlFilter,
                     Filter<Stub<?>> internalFilter,
                     String... orderByColumns)
Method Detail

getOrder

public String[] getOrder()

setOrder

public void setOrder(String... orderByColumns)

getSQLFilter

public Map<String,Object> getSQLFilter()
gives direct access to the embedded map


getInnerFilter

public Filter<? super Stub<?>> getInnerFilter()
Specified by:
getInnerFilter in interface CascadingFilter<Stub<?>>

setInnerFilter

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

isCombineWithAnd

public boolean isCombineWithAnd()
true by default


setCombineWithAnd

public void setCombineWithAnd(boolean flag)

accept

public boolean accept(Stub<?> stub)
always returns true; useful filtering only applies for the SQL-selection

Specified by:
accept in interface Filter<Stub<?>>


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