R
- type of resultpublic class ReductionMapper<R> extends AbstractContexed implements ResultMapper<R>
ResultMapper
that maps a single SQL reduction to a value of the same typeconn
Constructor and Description |
---|
ReductionMapper(AppContext c,
java.lang.Class<R> target,
Reduction op,
R def,
SQLExpression<? extends R> exp) |
Modifier and Type | Method and Description |
---|---|
java.lang.String |
getModify()
provide an override GROUP/ORDER by clause
null to use default order from filters
|
java.util.List<PatternArgument> |
getModifyParameters(java.util.List<PatternArgument> list)
Add parameters for the GROUP/ORDER clause to a list.
|
SQLFilter |
getRequiredFilter()
Get an additional Filter required to make the target string
work properly.
|
java.lang.String |
getTarget()
get the target clause of the SQL query.
|
java.util.List<PatternArgument> |
getTargetParameters(java.util.List<PatternArgument> list)
Add parameters for the target clause to a list.
|
R |
makeDefault()
Create a default Object to be returned if no SQL results are generated.
|
R |
makeObject(java.sql.ResultSet rs)
Convert a ResultSet into a domain object.
|
boolean |
setQualify(boolean qualify)
Request that field names should be qualified with the table
name where appropriate.
|
getContext, getLogger, resetLogger
public ReductionMapper(AppContext c, java.lang.Class<R> target, Reduction op, R def, SQLExpression<? extends R> exp)
c
- AppContext
target
- type of resultop
- Reduction
operationdef
- default resultexp
- SQLExpression
public java.lang.String getModify()
ResultMapper
getModify
in interface ResultMapper<R>
public java.lang.String getTarget()
ResultMapper
getTarget
in interface ResultMapper<R>
public R makeDefault()
ResultMapper
makeDefault
in interface ResultMapper<R>
public R makeObject(java.sql.ResultSet rs) throws DataException, java.sql.SQLException
ResultMapper
makeObject
in interface ResultMapper<R>
rs
- ResultSet or nullDataException
java.sql.SQLException
public boolean setQualify(boolean qualify)
ResultMapper
setQualify
in interface ResultMapper<R>
public SQLFilter getRequiredFilter()
ResultMapper
getRequiredFilter
in interface ResultMapper<R>
public java.util.List<PatternArgument> getTargetParameters(java.util.List<PatternArgument> list)
ResultMapper
getTargetParameters
in interface ResultMapper<R>
list
- to modifypublic java.util.List<PatternArgument> getModifyParameters(java.util.List<PatternArgument> list)
ResultMapper
getModifyParameters
in interface ResultMapper<R>
list
- to modify