com.massimo.tools.scriptrunner.work
Class SQLGeneratorTask
java.lang.Object
   com.massimo.tools.scriptrunner.AbstractTask
com.massimo.tools.scriptrunner.AbstractTask
       com.massimo.tools.scriptrunner.work.SQLTask
com.massimo.tools.scriptrunner.work.SQLTask
           com.massimo.tools.scriptrunner.work.SQLGeneratorTask
com.massimo.tools.scriptrunner.work.SQLGeneratorTask
- All Implemented Interfaces: 
- Task
- public class SQLGeneratorTask 
- extends SQLTask
TODO complete design and coding
 
 This task runs a SQL statement to generate new tasks. 
 These are run in instances of the templated task.
 
 
 
| Fields inherited from class com.massimo.tools.scriptrunner.work.SQLTask | 
| BIND_END_DELIMITERS, bindNames, connection, dbType, run_id, SQL_CHECK_PREFIX_ORACLE, SQL_CHECK_PREFIX_POSTGRES, SQL_CHECK_SUFFIX_ORACLE, SQL_CHECK_SUFFIX_POSTGRES, SQL_NON_COMMENT_PATTERN, SQL_STMT_PATTERN_ORACLE, SQL_STMT_PATTERN_POSTGRES | 
 
 
 
 
 
| Methods inherited from class com.massimo.tools.scriptrunner.work.SQLTask | 
| executeSQL, finalize, getBindNames, getSQLSplitPattern, getSQLText, getSQLWarning, parseTextIntoStatements, postCheck, preCheck, setBinds, substitiuteBinds, validateBinds, validateSQL | 
 
| Methods inherited from class com.massimo.tools.scriptrunner.AbstractTask | 
| getBooleanProperty, getCurrentWorkingDirectory, getDefinition, getIntProperty, getName, getParent, getProperties, getStartProcessingRow, getText, getType, interrupt, isIgnoreableError, isIgnoreableError, isInterrupted, isLogProgress, postProcess, preProcess, process, resultCodeToString, substituteParameters, toString, validate, validateConnections, validateParameters | 
 
 
SQLGeneratorTask
public SQLGeneratorTask(Task parent,
                        String type,
                        Element definition,
                        Map<String,String> parentConnectionProperties)
                 throws Exception
- Parameters:
- parent-
- type-
- definition-
- parentConnectionProperties-
- Throws:
- Exception
doProcess
protected int doProcess(ExecutionContext context)
                 throws Exception
- Description copied from class: SQLTask
- Implementing classes only need to do their own work and log progress when appropriate.
 
- 
- Overrides:
- doProcessin class- SQLTask
 
- 
- Returns:
- O for success. Anything else is a failure.
- Throws:
- Exception
- See Also:
- SQLTask.doProcess(com.massimo.tools.scriptrunner.context.ExecutionContext)
 
doValidate
protected int doValidate(ValidationContext context)
- Implement Task
 
 Check that template is well-formed,
 and that input is valid SQL.
 
- 
- Overrides:
- doValidatein class- SQLTask
 
- 
- Returns:
- 0 for success. Anything else is a failure.
 
generateBodies
protected String[] generateBodies(ExecutionContext context,
                                  String text)
                           throws SQLException,
                                  SRException
- 
- Parameters:
- context-
- text- Input text
- Returns:
- The generated child Task bodies
- Throws:
- SQLException
- SRException
 
generateTasks
protected Element[] generateTasks(String[] taskBodies,
                                  Element templateEl)
- 
- Parameters:
- taskBodies-
- templateEl-
- Returns:
- Array of generated Tasks
 
getLogger
protected org.apache.log4j.Logger getLogger()
- Description copied from class: SQLTask
- 
 
- 
- Overrides:
- getLoggerin class- SQLTask
 
- 
- Returns:
- Class logger
- See Also:
- AbstractTask.getLogger()