## 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` `GRAPHIC_PLAN` Graphic execution plan
`static int` `TEXT_PLAN` Text execution plan
`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

Method Summary
`java.lang.String` `getDatabaseDefinitionId()` Returns the database definition id
`int` `getMode()` Returns the show view mode
`int` `getPlanType()` Returns the plan type
`java.lang.String` `getSql()` Returns the sql statement
`void` `setDatabaseDefinitionId(java.lang.String databaseDefinitionId)` Sets the database definition id
`void` `setPlanType(int type)` Sets the plan type
`void` `setSql(java.lang.String sql)` Sets the sql statement

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

Field Detail

### GRAPHIC_PLAN

    public static final int GRAPHIC_PLAN

  Graphic execution plan

  See Also:
    Constant Field Values

### TEXT_PLAN

    public static final int TEXT_PLAN

  Text execution plan

  See Also:
    Constant Field Values

### 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

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, can be TEXT_PLAN or GRAPHIC_PLAN
  `mode` - the show view mode

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

Copyright © 2006 Actuate, IBM Corporation, Sybase, Inc. and others. All rights reserved.