Class QueryPlan
- java.lang.Object
-
- com.sun.jdo.spi.persistence.support.sqlstore.sql.generator.QueryPlan
-
- Direct Known Subclasses:
SelectQueryPlan
,UpdateQueryPlan
public abstract class QueryPlan extends Object
This class is used to generate SQL statements.
-
-
Field Summary
Fields Modifier and Type Field Description static int
ACT_DELETE
static int
ACT_INSERT
static int
ACT_NOOP
static int
ACT_SELECT
static int
ACT_UPDATE
protected int
action
protected ClassDesc
config
protected static ResourceBundle
messages
I18N message handler.protected static int
ST_BUILT
ArrayList
statements
Array of Statement.protected int
status
Bitmask containing one ofST_BUILT
,SelectQueryPlan.ST_C_BUILT
,SelectQueryPlan.ST_OC_BUILT
,SelectQueryPlan.ST_JOINED
protected SQLStoreManager
store
protected ArrayList
tables
Array of QueryTable.
-
Constructor Summary
Constructors Constructor Description QueryPlan(ActionDesc desc, SQLStoreManager store)
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description QueryTable
addQueryTable(TableDesc tableDesc)
QueryTable
addQueryTable(org.netbeans.modules.dbschema.TableElement tableElement, ClassDesc persistenceConfig)
Identifies a database table which will become part of this query plan.void
addQueryTables(ArrayList queryTables)
Add all the tables fromqueryTables
to the current query plan.protected Statement
addStatement(QueryTable t)
abstract void
build()
protected Statement
createStatement(QueryTable t)
QueryTable
findQueryTable(TableDesc tableDesc)
Finds the QueryTable object that this query plan is using to describe the TableDesc indicated by the tableDesc parameter.QueryTable
findQueryTable(org.netbeans.modules.dbschema.TableElement tableElement)
Finds the QueryTable object that this query plan is using to describe the TableElement indicated by the tableElement parameter.int
getAction()
ClassDesc
getConfig()
protected Statement
getStatement(QueryTable t)
ArrayList
getStatements()
protected abstract Statement
newStatement()
protected void
processStatements()
This method goes through the statement list and tries to set up relationship between statements based on secondary table keys.
-
-
-
Field Detail
-
ACT_UPDATE
public static final int ACT_UPDATE
- See Also:
- Constant Field Values
-
ACT_INSERT
public static final int ACT_INSERT
- See Also:
- Constant Field Values
-
ACT_DELETE
public static final int ACT_DELETE
- See Also:
- Constant Field Values
-
ACT_SELECT
public static final int ACT_SELECT
- See Also:
- Constant Field Values
-
ACT_NOOP
public static final int ACT_NOOP
- See Also:
- Constant Field Values
-
ST_BUILT
protected static final int ST_BUILT
- See Also:
- Constant Field Values
-
statements
public ArrayList statements
Array of Statement.
-
config
protected ClassDesc config
-
status
protected int status
Bitmask containing one ofST_BUILT
,SelectQueryPlan.ST_C_BUILT
,SelectQueryPlan.ST_OC_BUILT
,SelectQueryPlan.ST_JOINED
-
action
protected int action
-
store
protected SQLStoreManager store
-
tables
protected ArrayList tables
Array of QueryTable.
-
messages
protected static final ResourceBundle messages
I18N message handler.
-
-
Constructor Detail
-
QueryPlan
public QueryPlan(ActionDesc desc, SQLStoreManager store)
-
-
Method Detail
-
addQueryTable
public QueryTable addQueryTable(TableDesc tableDesc)
-
addQueryTable
public QueryTable addQueryTable(org.netbeans.modules.dbschema.TableElement tableElement, ClassDesc persistenceConfig)
Identifies a database table which will become part of this query plan. We will build a QueryTable object describing its use and return it. Note: No join is constructed at this point for the table added.- Parameters:
tableElement
- Identifies which table is being added.persistenceConfig
- If we are adding a foreign table the persistenceConfig parameter holds the PersistenceConfig for the foreign Persistence Class.
-
addQueryTables
public void addQueryTables(ArrayList queryTables)
Add all the tables fromqueryTables
to the current query plan. Useful when transfering tables when joining query plans together.- Parameters:
queryTables
- Query tables from the foreign plan to be added.
-
findQueryTable
public QueryTable findQueryTable(org.netbeans.modules.dbschema.TableElement tableElement)
Finds the QueryTable object that this query plan is using to describe the TableElement indicated by the tableElement parameter.
-
findQueryTable
public QueryTable findQueryTable(TableDesc tableDesc)
Finds the QueryTable object that this query plan is using to describe the TableDesc indicated by the tableDesc parameter.
-
getStatements
public ArrayList getStatements()
-
addStatement
protected Statement addStatement(QueryTable t)
-
newStatement
protected abstract Statement newStatement()
-
createStatement
protected Statement createStatement(QueryTable t)
-
getStatement
protected Statement getStatement(QueryTable t)
-
build
public abstract void build()
-
processStatements
protected void processStatements()
This method goes through the statement list and tries to set up relationship between statements based on secondary table keys.
-
getAction
public int getAction()
-
getConfig
public ClassDesc getConfig()
-
-