|
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.PreparedStatementEntryFilter<T>
public class PreparedStatementEntryFilter<T>
a special filter that directly works off a PreparedStatement; only suitable for pre-filtering from the database, unless an internalFilter is set in addition.
BaseRowMapper| Field Summary | |
|---|---|
protected Connection |
con
|
protected Filter<? super T> |
internalFilter
|
protected Object[] |
parameters
|
protected PreparedStatement |
pst
|
protected String |
sql
|
| Fields inherited from interface com.antelmann.util.Filter |
|---|
EXCLUDE_ALL_FILTER, INCLUDE_ALL_FILTER |
| Constructor Summary | |
|---|---|
protected |
PreparedStatementEntryFilter()
the fields remain uninitialized; the PreparedStatement must be initialized by the constructor of the subclass |
|
PreparedStatementEntryFilter(Connection con,
String sql)
|
|
PreparedStatementEntryFilter(Connection con,
String sql,
Filter<? super T> internalFilter,
Object... parameters)
|
|
PreparedStatementEntryFilter(PreparedStatement pst,
Filter<? super T> internalFilter)
when only using this constructor, reInitialize() will throw an IllegalStateException, as the PreparedStatement cannot be regenerated just by itself. |
| Method Summary | |
|---|---|
boolean |
accept(T entry)
if no internalFilter is set, true is returned; otherwise the internalFilter determines the return value |
void |
close()
|
Filter<? super T> |
getInnerFilter()
|
Object[] |
getParameters()
|
PreparedStatement |
getPreparedStatement()
|
String |
getSQLString()
|
void |
reInitialize()
reinitializes the embedded PreparedStatement with the sql string and the parameters; useful to call for reusing the filter after some usage may have closed the statement |
void |
setInnerFilter(Filter<? super T> filter)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected Connection con
protected PreparedStatement pst
protected Filter<? super T> internalFilter
protected String sql
protected Object[] parameters
| Constructor Detail |
|---|
protected PreparedStatementEntryFilter()
public PreparedStatementEntryFilter(Connection con,
String sql)
throws SQLException
SQLException
public PreparedStatementEntryFilter(Connection con,
String sql,
Filter<? super T> internalFilter,
Object... parameters)
throws SQLException
SQLException
public PreparedStatementEntryFilter(PreparedStatement pst,
Filter<? super T> internalFilter)
throws SQLException
SQLException| Method Detail |
|---|
public void reInitialize()
throws IllegalStateException,
SQLException
IllegalStateException
SQLExceptionpublic PreparedStatement getPreparedStatement()
public String getSQLString()
public Object[] getParameters()
public Filter<? super T> getInnerFilter()
getInnerFilter in interface CascadingFilter<T>public void setInnerFilter(Filter<? super T> filter)
setInnerFilter in interface CascadingFilter<T>public boolean accept(T entry)
accept in interface Filter<T>
public void close()
throws IOException
close in interface CloseableIOException
|
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||