|
Holger's Java API |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.antelmann.sql.SQLComboFilter<T>
public class SQLComboFilter<T>
allows to flexibly combine multiple different filter that all can be effectively
applied to a BaseRowMapper.
Note that the order of embedded SQLMapFilters or SQLComboFilter is completely ignored!
Instead, set the order for this top-level SQLComboFilter to have it recognized by the BaseRowMapper
Most flexibility is obtained by using one SQLComboFilter in another.
SQLMapFilter,
FullTextSearchFilter,
Serialized Form| Field Summary |
|---|
| Fields inherited from interface com.antelmann.util.Filter |
|---|
EXCLUDE_ALL_FILTER, INCLUDE_ALL_FILTER |
| Constructor Summary | |
|---|---|
SQLComboFilter(SQLComboFilterSupported<? super T> filter)
|
|
| Method Summary | ||
|---|---|---|
boolean |
accept(T entry)
this implementation returns false if and only if an existing innerFilter doesn't accept the given entry |
|
void |
add(SQLComboFilterSupported<? super T> filter,
boolean combineWithAndIfTrue)
|
|
protected void |
addFilterStatement(Connection con,
String table,
Filter<?> filter,
StringBuilder sb,
ArrayList<Object> params)
|
|
protected void |
addWhereClause(Connection con,
String table,
StringBuilder sb,
ArrayList<Object> params)
|
|
SQLComboFilter<Stub<?>> |
asStubFilter()
|
|
boolean |
contains(Filter<?> filter)
|
|
PreparedStatementEntryFilter<T> |
createPreparedStatementEntryFilter(BaseRowMapper<?> mapper,
Connection con,
String tableQuery,
String... selectColumns)
|
|
PreparedStatementEntryFilter<T> |
createPreparedStatementEntryFilter(Connection con,
String tableQuery,
String... selectColumns)
|
|
|
createPreparedStatementEntryFilter(DBClassStore<E> store)
Deprecated. cannot extract the mapper this way, so this is discouraged |
|
String |
createQueryString(BaseRowMapper<?> mapper,
Connection con,
String tableQuery,
ArrayList<Object> params,
String... selectColumns)
|
|
SubSelectCondition |
createSubSelectCondition(BaseRowMapper<?> mapper,
Connection con,
String tableQuery,
String idColumn)
|
|
SubSelectCondition |
createSubSelectCondition(Connection con,
String tableQuery,
String idColumn)
|
|
SubSelectCondition |
createSubSelectCondition(DBClassStore<?> store)
|
|
Filter<?>[] |
getAllFilters()
returns all filters that this instance is using in some combined fashion |
|
Filter<? super T> |
getInnerFilter()
|
|
String[] |
getRestrictToColumns()
see setRestrictToColumns(String...) |
|
boolean |
hasConditions()
|
|
protected static boolean |
hasConditions(Filter<?> filter)
|
|
boolean |
isNegated()
if true, the generated PreparedStatement will use 'not' to negate the entire statement; false is the default. |
|
void |
setInnerFilter(Filter<? super T> filter)
|
|
void |
setNegated(boolean flag)
allows to negate the entire where-clause of the PreparedStatement when it is generated; the inner filter remains untouched. |
|
void |
setOrderByColumns(String... orderByColumns)
|
|
void |
setRestrictToColumns(String... columns)
allows to override the restricted columns to be mapped; the override only applies if a non-null, non-empty array is given. |
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public SQLComboFilter(SQLComboFilterSupported<? super T> filter)
| Method Detail |
|---|
public boolean isNegated()
setNegated(boolean)public void setNegated(boolean flag)
createPreparedStatementEntryFilter(Connection, String, String...)public Filter<?>[] getAllFilters()
@Deprecated
public <E extends DBEntry> PreparedStatementEntryFilter<T> createPreparedStatementEntryFilter(DBClassStore<E> store)
throws SQLException
SQLException
public PreparedStatementEntryFilter<T> createPreparedStatementEntryFilter(Connection con,
String tableQuery,
String... selectColumns)
throws SQLException
SQLException
public PreparedStatementEntryFilter<T> createPreparedStatementEntryFilter(BaseRowMapper<?> mapper,
Connection con,
String tableQuery,
String... selectColumns)
throws SQLException
SQLException
public SubSelectCondition createSubSelectCondition(DBClassStore<?> store)
throws SQLException
SQLException
public SubSelectCondition createSubSelectCondition(Connection con,
String tableQuery,
String idColumn)
throws SQLException
SQLException
public SubSelectCondition createSubSelectCondition(BaseRowMapper<?> mapper,
Connection con,
String tableQuery,
String idColumn)
throws SQLException
SQLException
public String createQueryString(BaseRowMapper<?> mapper,
Connection con,
String tableQuery,
ArrayList<Object> params,
String... selectColumns)
throws SQLException
SQLExceptionpublic boolean hasConditions()
protected static boolean hasConditions(Filter<?> filter)
protected void addWhereClause(Connection con,
String table,
StringBuilder sb,
ArrayList<Object> params)
throws SQLException
SQLException
protected void addFilterStatement(Connection con,
String table,
Filter<?> filter,
StringBuilder sb,
ArrayList<Object> params)
throws SQLException
SQLExceptionpublic void setOrderByColumns(String... orderByColumns)
public void add(SQLComboFilterSupported<? super T> filter,
boolean combineWithAndIfTrue)
public boolean contains(Filter<?> filter)
public boolean accept(T entry)
accept in interface Filter<T>public Filter<? super T> getInnerFilter()
getInnerFilter in interface CascadingFilter<T>public void setInnerFilter(Filter<? super T> filter)
setInnerFilter in interface CascadingFilter<T>public void setRestrictToColumns(String... columns)
BaseRowMapper.setRestrictedMappedColumns(String[])public String[] getRestrictToColumns()
setRestrictToColumns(String...)
public SQLComboFilter<Stub<?>> asStubFilter()
throws RuntimeException
RuntimeException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||