## org.eclipse.datatools.sqltools.plan
Class PlanRequest

    java.lang.Object
      org.eclipse.datatools.sqltools.plan.PlanRequest

    public class PlanRequest

extends java.lang.Object

Start point to use EPV (SQL Execution Plan View), every time when the consumer needs to display an execution plan on EPV, it must construct an instance of `PlanRequest` first. This class encapsulates all necessary information:

- DatabaseDefinitionId: This is used to uniquely identify a database product, the format is: "product name" plus "_" plus "product version", for example, Derby_10.0. This id will be displayed together with the SQL statement as the name of this plan item
- PlanType: Can be text execution plan or graphic execution plan
- SQL: The SQL statement from which the execution is generated

Author:
  Hui Cao

Field Summary
`static int` `FAILED` Indicates it's failed to generated the execution plan
`static int` `RUNNING` Indicates that the plan is generating, still not finished
`static int` `SUCCESS` Indicates that the plan is successfully generated
`static int` `VIEW_ACTIVATE` Make the SQL Execution Plan view visible and activated
`static int` `VIEW_CREATE` Make the SQL Execution Plan view to be made created but not necessarily be made visible
`static int` `VIEW_VISIBLE`

Constructor Summary
`PlanRequest(java.lang.String sql, java.lang.String databaseDefinitionId, int planType, int mode)` Constructs a plan request
`PlanRequest(java.lang.String sql, java.lang.String databaseDefinitionId, int planType, int mode, java.util.Map varDecs)`

Method Summary
`java.lang.Object` `getData()`
`java.lang.String` `getDatabaseDefinitionId()` Returns the database definition id
`java.lang.String` `getDbName()`
`int` `getMode()` Returns the show view mode
`int` `getPlanType()` Returns the plan type
`java.lang.String` `getProfileName()`
`java.lang.String` `getSql()` Returns the sql statement
`java.util.Map` `getVarDecs()`
`boolean` `isNoexec()`
`void` `setData(java.lang.Object data)`
`void` `setDatabaseDefinitionId(java.lang.String databaseDefinitionId)` Sets the database definition id
`void` `setDbName(java.lang.String name)`
`void` `setNoexec(boolean _noexec)`
`void` `setPlanType(int type)` Sets the plan type
`void` `setProfileName(java.lang.String name)`
`void` `setSql(java.lang.String sql)` Sets the sql statement
`void` `setVarDecs(java.util.Map decs)`

Methods inherited from class java.lang.Object
`equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

Field Detail

### VIEW_ACTIVATE

    public static final int VIEW_ACTIVATE

  Make the SQL Execution Plan view visible and activated

  See Also:
    Constant Field Values

### VIEW_VISIBLE

    public static final int VIEW_VISIBLE

See Also:
  Constant Field Values

### VIEW_CREATE

    public static final int VIEW_CREATE

  Make the SQL Execution Plan view to be made created but not necessarily be made visible

  See Also:
    Constant Field Values

### RUNNING

    public static final int RUNNING

  Indicates that the plan is generating, still not finished

  See Also:
    Constant Field Values

### SUCCESS

    public static final int SUCCESS

  Indicates that the plan is successfully generated

  See Also:
    Constant Field Values

### FAILED

    public static final int FAILED

  Indicates it's failed to generated the execution plan

  See Also:
    Constant Field Values

Constructor Detail

### PlanRequest

    public PlanRequest(java.lang.String sql,
                       java.lang.String databaseDefinitionId,
                       int planType,
                       int mode)

  Constructs a plan request

  Parameters:
    `sql` - the SQL statement from which the execution plan is generated
    `databaseDefinitionId` - the database definition id, use "product_name"_"version" to uniquely identify a database product
    `planType` - the plan type, vendor-specific plan types
    `mode` - the show view mode

### PlanRequest

    public PlanRequest(java.lang.String sql,
                       java.lang.String databaseDefinitionId,
                       int planType,
                       int mode,
                       java.util.Map varDecs)

Method Detail

### getDatabaseDefinitionId

    public java.lang.String getDatabaseDefinitionId()

  Returns the database definition id

  Returns:
    the database definition id

### getPlanType

    public int getPlanType()

  Returns the plan type

  Returns:
    the plan type

### getSql

    public java.lang.String getSql()

  Returns the sql statement

  Returns:
    the sql statement

### setDatabaseDefinitionId

    public void setDatabaseDefinitionId(java.lang.String databaseDefinitionId)

  Sets the database definition id

  Parameters:
    `databaseDefinitionId` - the database definition id

### setPlanType

    public void setPlanType(int type)

  Sets the plan type

  Parameters:
    `type` - the plan type

### setSql

    public void setSql(java.lang.String sql)

  Sets the sql statement

  Parameters:
    `sql` - the sql statement

### getMode

    public int getMode()

  Returns the show view mode

  Returns:
    the show view mode

### isNoexec

    public boolean isNoexec()

  Returns:
    Returns whether to execute the sql statement when retrieving the execution plan

### setNoexec

    public void setNoexec(boolean _noexec)

  Parameters:
    `_noexec` - Sets whether to execute the sql statement when retrieving the execution plan

### getData

    public java.lang.Object getData()

### setData

    public void setData(java.lang.Object data)

### getVarDecs

    public java.util.Map getVarDecs()

### setVarDecs

    public void setVarDecs(java.util.Map decs)

### getProfileName

    public java.lang.String getProfileName()

### setProfileName

    public void setProfileName(java.lang.String name)

### getDbName

    public java.lang.String getDbName()

### setDbName

    public void setDbName(java.lang.String name)