Class SqlDataLoader
java.lang.Object
io.jmix.reports.yarg.loaders.impl.AbstractDataLoader
io.jmix.reports.yarg.loaders.impl.AbstractDbDataLoader
io.jmix.reports.yarg.loaders.impl.SqlDataLoader
- All Implemented Interfaces:
ReportDataLoader
- Direct Known Subclasses:
JmixSqlDataLoader
Loads data from database using sql
You can use aliases for output values
Example:
select login as "Login", password as "Password" from user where create_ts > ${startDate}
${startDate} is alias of the input parameter, which will be passed to the query
-
Nested Class Summary
Nested classes/interfaces inherited from class io.jmix.reports.yarg.loaders.impl.AbstractDbDataLoader
AbstractDbDataLoader.OutputValue, AbstractDbDataLoader.QueryPack, AbstractDbDataLoader.QueryParameter
-
Field Summary
Fields inherited from class io.jmix.reports.yarg.loaders.impl.AbstractDbDataLoader
COMMON_PARAM_PATTERN
Fields inherited from class io.jmix.reports.yarg.loaders.impl.AbstractDataLoader
fieldsConverter, parametersConverter
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionThis method MUST return list of mutable maps.protected List
runQuery
(ReportQuery reportQuery, String queryString, Object[] params, ResultSetHandler<List> handler) Methods inherited from class io.jmix.reports.yarg.loaders.impl.AbstractDbDataLoader
fillOutputData, findParameterNames, insertParameterToQuery, prepareQuery, processQueryTemplate
Methods inherited from class io.jmix.reports.yarg.loaders.impl.AbstractDataLoader
addParentBandDataToParameters, convertOutputValue, convertParameter, getFieldsConverter, getParametersConverter, setFieldsConverter, setParametersConverter
-
Constructor Details
-
SqlDataLoader
-
-
Method Details
-
loadData
public List<Map<String,Object>> loadData(ReportQuery reportQuery, BandData parentBand, Map<String, Object> params) Description copied from interface:ReportDataLoader
This method MUST return list of mutable maps. We need mutability to put there some values implicitly. -
runQuery
protected List runQuery(ReportQuery reportQuery, String queryString, Object[] params, ResultSetHandler<List> handler) throws SQLException - Throws:
SQLException
-
getDataSource
-