Package se.ikama.bauta.batch.tasklet
Class SqlToCsvReportTasklet
- java.lang.Object
-
- se.ikama.bauta.batch.tasklet.ReportTasklet
-
- se.ikama.bauta.batch.tasklet.SqlToCsvReportTasklet
-
- All Implemented Interfaces:
org.springframework.batch.core.step.tasklet.Tasklet,org.springframework.beans.factory.InitializingBean,ReportGenerator
public class SqlToCsvReportTasklet extends ReportTasklet implements ReportGenerator, org.springframework.beans.factory.InitializingBean
Generates a CSV file based on an SQL query
-
-
Field Summary
Fields Modifier and Type Field Description protected intqueryTimeoutQuery timeout in seconds-
Fields inherited from class se.ikama.bauta.batch.tasklet.ReportTasklet
failIfValidationFailures, reportDir
-
-
Constructor Summary
Constructors Constructor Description SqlToCsvReportTasklet()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidafterPropertiesSet()ReportGenerationResultgenerateReport(java.io.File reportFile, org.springframework.batch.core.StepContribution sc, org.springframework.batch.core.scope.context.ChunkContext cc)Generate a report-
Methods inherited from class se.ikama.bauta.batch.tasklet.ReportTasklet
addReportGenerator, execute, setReportGenerators
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface se.ikama.bauta.batch.tasklet.ReportGenerator
getReportFilename, getReportName
-
-
-
-
Method Detail
-
afterPropertiesSet
public void afterPropertiesSet() throws java.lang.Exception- Specified by:
afterPropertiesSetin interfaceorg.springframework.beans.factory.InitializingBean- Throws:
java.lang.Exception
-
generateReport
@Transactional(readOnly=true, transactionManager="stagingTransactionManager") public ReportGenerationResult generateReport(java.io.File reportFile, org.springframework.batch.core.StepContribution sc, org.springframework.batch.core.scope.context.ChunkContext cc) throws java.lang.ExceptionDescription copied from interface:ReportGeneratorGenerate a report- Specified by:
generateReportin interfaceReportGenerator- Parameters:
reportFile- The file to write the report tosc- The current step contributioncc- The current ChunkContext- Returns:
- A ReportGenerationResult. Typically with the status OK.
For certain types of report generators with a notion of "failure", it may make sense to return Failed, to support. See @
SqlValidationTasklet - Throws:
java.lang.Exception
-
-