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 intACT_DELETEstatic intACT_INSERTstatic intACT_NOOPstatic intACT_SELECTstatic intACT_UPDATEprotected intactionprotected ClassDescconfigprotected static ResourceBundlemessagesI18N message handler.protected static intST_BUILTArrayListstatementsArray of Statement.protected intstatusBitmask containing one ofST_BUILT,SelectQueryPlan.ST_C_BUILT,SelectQueryPlan.ST_OC_BUILT,SelectQueryPlan.ST_JOINEDprotected SQLStoreManagerstoreprotected ArrayListtablesArray 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 QueryTableaddQueryTable(TableDesc tableDesc)QueryTableaddQueryTable(org.netbeans.modules.dbschema.TableElement tableElement, ClassDesc persistenceConfig)Identifies a database table which will become part of this query plan.voidaddQueryTables(ArrayList queryTables)Add all the tables fromqueryTablesto the current query plan.protected StatementaddStatement(QueryTable t)abstract voidbuild()protected StatementcreateStatement(QueryTable t)QueryTablefindQueryTable(TableDesc tableDesc)Finds the QueryTable object that this query plan is using to describe the TableDesc indicated by the tableDesc parameter.QueryTablefindQueryTable(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.intgetAction()ClassDescgetConfig()protected StatementgetStatement(QueryTable t)ArrayListgetStatements()protected abstract StatementnewStatement()protected voidprocessStatements()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 fromqueryTablesto 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()
-
-