it.openutils.migration.task.setup
Class GenericConditionalTask

java.lang.Object
  extended by it.openutils.migration.task.setup.BaseDbTask
      extended by it.openutils.migration.task.setup.BaseConditionalTask
          extended by it.openutils.migration.task.setup.GenericConditionalTask
All Implemented Interfaces:
DbTask
Direct Known Subclasses:
GenericScriptBasedConditionalTask, JdbcObjectCreationTask, SqlServerFunctionCreateOrUpdateTask, SqlServerGenericAlterTask, SqlServerObjCreationTask, SqlServerProcedureCreateOrUpdateTask, SqlServerViewCreateOrUpdateTask

public class GenericConditionalTask
extends BaseConditionalTask

A siple update task that executes a query and apply a DDL only if the query retuns a certain value (by default 0)

Version:
$Id: GenericConditionalTask.java 568 2008-01-27 15:25:47Z fgiust $
Author:
fgiust

Field Summary
protected  java.lang.String check
          Query for the check condition.
protected  java.lang.Integer triggerValue
          The value that will let the ddl script start.
 
Fields inherited from class it.openutils.migration.task.setup.BaseConditionalTask
ddl, log, not, scripts, variables
 
Fields inherited from class it.openutils.migration.task.setup.BaseDbTask
description
 
Constructor Summary
GenericConditionalTask()
           
 
Method Summary
 boolean check(org.springframework.jdbc.core.simple.SimpleJdbcTemplate jdbcTemplate)
          Subclasses need to override this method and provide specific checks.
 java.lang.String getCheck()
          Returns the check.
 java.lang.String getDescription()
          Returns a description for this task
 void setCheck(java.lang.String name)
          
 void setSourceDb(java.lang.String sourceDb)
          Deprecated.  
 void setTriggerValue(java.lang.Integer triggerValue)
          Sets the triggerValue.
 
Methods inherited from class it.openutils.migration.task.setup.BaseConditionalTask
execute, objectNameFromFileName, performSubstitution, setDdl, setDdlScript, setNot, setScripts
 
Methods inherited from class it.openutils.migration.task.setup.BaseDbTask
setDescription
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

check

protected java.lang.String check
Query for the check condition.


triggerValue

protected java.lang.Integer triggerValue
The value that will let the ddl script start. Default is 0.

Constructor Detail

GenericConditionalTask

public GenericConditionalTask()
Method Detail

setCheck

public final void setCheck(java.lang.String name)


getCheck

public java.lang.String getCheck()
Returns the check.

Returns:
the check

setTriggerValue

public final void setTriggerValue(java.lang.Integer triggerValue)
Sets the triggerValue.

Parameters:
triggerValue - the triggerValue to set

getDescription

public java.lang.String getDescription()
Returns a description for this task

Specified by:
getDescription in interface DbTask
Overrides:
getDescription in class BaseConditionalTask
Returns:
task description

check

public boolean check(org.springframework.jdbc.core.simple.SimpleJdbcTemplate jdbcTemplate)
Subclasses need to override this method and provide specific checks.

Specified by:
check in class BaseConditionalTask
Parameters:
jdbcTemplate - SimpleJdbcTemplate
Returns:
true if the condition is met

setSourceDb

@Deprecated
public final void setSourceDb(java.lang.String sourceDb)
Deprecated. 

Sets the sourceDb.

Parameters:
sourceDb - the sourceDb to set


Copyright © 2008 Openmind. All Rights Reserved.