db-derby-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From d..@apache.org
Subject svn commit: r1495305 [6/21] - in /db/derby/code/trunk: java/engine/org/apache/derby/ java/engine/org/apache/derby/catalog/types/ java/engine/org/apache/derby/iapi/services/io/ java/engine/org/apache/derby/iapi/sql/ java/engine/org/apache/derby/iapi/sql...
Date Fri, 21 Jun 2013 07:47:52 GMT
Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLModStatementNode.java Fri Jun 21 07:47:47 2013
@@ -25,7 +25,6 @@ import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
 import java.util.Set;
-
 import org.apache.derby.catalog.DefaultInfo;
 import org.apache.derby.catalog.UUID;
 import org.apache.derby.iapi.error.StandardException;
@@ -37,9 +36,8 @@ import org.apache.derby.iapi.services.co
 import org.apache.derby.iapi.services.io.FormatableBitSet;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.sql.StatementType;
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
-import org.apache.derby.iapi.sql.compile.NodeFactory;
+import org.apache.derby.iapi.sql.compile.OptimizerFactory;
 import org.apache.derby.iapi.sql.compile.Parser;
 import org.apache.derby.iapi.sql.compile.Visitable;
 import org.apache.derby.iapi.sql.compile.Visitor;
@@ -59,8 +57,8 @@ import org.apache.derby.iapi.sql.diction
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
-import org.apache.derby.iapi.types.DataTypeDescriptor;
 import org.apache.derby.iapi.store.access.TransactionController;
+import org.apache.derby.iapi.types.DataTypeDescriptor;
 import org.apache.derby.impl.sql.execute.FKInfo;
 import org.apache.derby.impl.sql.execute.TriggerInfo;
 
@@ -81,7 +79,7 @@ abstract class DMLModStatementNode exten
 	protected FKInfo[]			fkInfo;			// array of FKInfo structures
 												// generated during bind
 	protected TriggerInfo		triggerInfo;	// generated during bind
-	public TableDescriptor		targetTableDescriptor;
+    TableDescriptor     targetTableDescriptor;
 
 
 	/* The indexes that could be affected by this statement */
@@ -109,30 +107,26 @@ abstract class DMLModStatementNode exten
     /** Set of dependent tables for cascading deletes. */
     Set<String> dependentTables;
 
-	/**
-	 * Initializer for a DMLModStatementNode -- delegate to DMLStatementNode
-	 *
-	 * @param resultSet	A ResultSetNode for the result set of the
-	 *			DML statement
-	 */
-	public void init(Object resultSet)
-	{
-		super.init(resultSet);
-		statementType = getStatementType();
-	}
+    DMLModStatementNode(ResultSetNode resultSet, ContextManager cm) {
+        super(resultSet, cm);
+        statementType = getStatementType();
+    }
 
 	/**
-	 * Initializer for a DMLModStatementNode -- delegate to DMLStatementNode
+     * Constructor for a DMLModStatementNode -- delegate to DMLStatementNode
 	 *
 	 * @param resultSet	A ResultSetNode for the result set of the
 	 *			DML statement
 	 * @param statementType used by nodes that allocate a DMLMod directly
 	 *			(rather than inheriting it).
+     * @param cm        The context manager
 	 */
-	public void init(Object resultSet, Object statementType)
+    DMLModStatementNode(ResultSetNode resultSet,
+                        int statementType,
+                        ContextManager cm)
 	{
-		super.init(resultSet);
-		this.statementType = ((Integer) statementType).intValue();
+        super(resultSet, cm);
+        this.statementType = statementType;
 	}
 
 	void setTarget(QueryTreeNode targetName)
@@ -254,7 +248,7 @@ abstract class DMLModStatementNode exten
 			 * the JDBC2.0 getMetaData() and getResultSetConcurrency()
 			 * methods and return an updatable ResultSet.
 			 */
-			FromList dummyFromList = new FromList();
+            FromList dummyFromList = new FromList(getContextManager());
 			targetVTI = (FromVTI) targetVTI.bindNonVTITables(dataDictionary, dummyFromList);
 			targetVTI = (FromVTI) targetVTI.bindVTITables(dummyFromList);
 		}
@@ -266,6 +260,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @return true 
 	 */	
+    @Override
 	public boolean isAtomic()
 	{
 		return true;
@@ -280,7 +275,7 @@ abstract class DMLModStatementNode exten
 	* @exception	StandardException	throws on schema name
 	*						that doesn't exist	
 	*/
-	public SchemaDescriptor getSchemaDescriptor() throws StandardException
+    SchemaDescriptor getSchemaDescriptor() throws StandardException
 	{
 		SchemaDescriptor		sd;
 
@@ -305,7 +300,8 @@ abstract class DMLModStatementNode exten
 	  the language both use 0 base or 1 base offsets for columns. Today
 	  we can't use the store function because we have a 1 based FormatableBitSet.
 	  */
-	public static int[] getReadColMap(int column_map_length,FormatableBitSet readColsBitSet)
+    static int[] getReadColMap(int column_map_length,
+                               FormatableBitSet readColsBitSet)
 	{
 		if (readColsBitSet == null) return null;
 
@@ -357,23 +353,17 @@ abstract class DMLModStatementNode exten
 		throws StandardException
 	{
 		/* Get a ResultColumnList representing all the columns in the target */
-		FromBaseTable	fbt =
-			(FromBaseTable)
-				(getNodeFactory().getNode(
-										C_NodeTypes.FROM_BASE_TABLE,
-										synonymTableName != null ? synonymTableName : targetTableName,
-										null,
-										null,
-										null,
-										getContextManager())
-				);
+        FromBaseTable fbt = new FromBaseTable(
+                synonymTableName != null ? synonymTableName : targetTableName,
+                null,
+                null,
+                null,
+                getContextManager());
 
 		fbt.bindNonVTITables(
 			getDataDictionary(),
-			(FromList) getNodeFactory().getNode(
-								C_NodeTypes.FROM_LIST,
-								getNodeFactory().doJoinOrderOptimization(),
-								getContextManager()));
+            new FromList(getOptimizerFactory().doJoinOrderOptimization(),
+                         getContextManager()));
 
 		getResultColumnList(
 							fbt,
@@ -452,13 +442,8 @@ abstract class DMLModStatementNode exten
 
                 // insert CAST in case column data type is not same as the
                 // resolved type of the generation clause
-                generationClause = (ValueNode) getNodeFactory().getNode
-                    (
-                     C_NodeTypes.CAST_NODE,
-                     generationClause,
-                     dtd,
-                     getContextManager()
-                     );
+                generationClause =
+                    new CastNode(generationClause, dtd, getContextManager());
                 
                 // Assignment semantics of implicit cast here:
                 // Section 9.2 (Store assignment). There, General Rule 
@@ -476,15 +461,22 @@ abstract class DMLModStatementNode exten
                 compilerContext.pushCompilationSchema( originalCurrentSchema );
 
 				try {
-                    bindRowScopedExpression( getNodeFactory(), getContextManager(), targetTableDescriptor, sourceRCL, generationClause );
+                    bindRowScopedExpression(
+                        getOptimizerFactory(),
+                        getContextManager(),
+                        targetTableDescriptor,
+                        sourceRCL,
+                        generationClause );
                 }
                 finally
                 {
                     compilerContext.popCompilationSchema();
                 }
 
-                ResultColumn    newRC =  (ResultColumn) getNodeFactory().getNode
-                    ( C_NodeTypes.RESULT_COLUMN, generationClause.getTypeServices(), generationClause, getContextManager());
+                ResultColumn newRC = new ResultColumn(
+                    generationClause.getTypeServices(),
+                    generationClause,
+                    getContextManager());
 
                 // replace the result column in place
                 newRC.setVirtualColumnId( i + 1 ); // column ids are 1-based
@@ -532,7 +524,6 @@ abstract class DMLModStatementNode exten
 		Parser						p;
 		ValueNode					clauseTree;
 		LanguageConnectionContext	lcc = getLanguageConnectionContext();
-		CompilerContext 			compilerContext = getCompilerContext();
 
 		/* Get a Statement to pass to the parser */
 
@@ -615,7 +606,7 @@ abstract class DMLModStatementNode exten
 	ValueNode bindConstraints
 	(
 		DataDictionary		dataDictionary,
-		NodeFactory			nodeFactory,
+        OptimizerFactory    optimizerFactory,
 		TableDescriptor		targetTableDescriptor,
 		Dependent			dependent,
 		ResultColumnList	sourceRCL,
@@ -665,7 +656,8 @@ abstract class DMLModStatementNode exten
                 compilerContext.pushCompilationSchema( originalCurrentSchema );
 
                 try {
-                    bindRowScopedExpression(nodeFactory, getContextManager(),
+                    bindRowScopedExpression(optimizerFactory,
+                                            getContextManager(),
                                             targetTableDescriptor,
                                             sourceRCL,
                                             checkConstraints);
@@ -688,17 +680,19 @@ abstract class DMLModStatementNode exten
 	 * Binds an already parsed expression that only involves columns in a single
 	 * row. E.g., a check constraint or a generation clause.
 	 *
-	 * @param nodeFactory			Where to get query tree nodes.
-	 * @param targetTableDescriptor	The TableDescriptor for the constrained table.
-	 * @param sourceRCL		Result columns.
-	 * @param expression		Parsed query tree for row scoped expression
+     * @param optimizerFactory      The optimizer factory
+     * @param cm                    The context manager
+     * @param targetTableDescriptor The TableDescriptor for the constrained
+     *                              table
+     * @param sourceRCL             Result columns
+     * @param expression            Parsed query tree for row scoped expression
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
 	static void	bindRowScopedExpression
 	(
-		NodeFactory			nodeFactory,
-        ContextManager    contextManager,
+        OptimizerFactory    optimizerFactory,
+        ContextManager      cm,
 		TableDescriptor		targetTableDescriptor,
 		ResultColumnList	sourceRCL,
 		ValueNode			expression
@@ -706,8 +700,10 @@ abstract class DMLModStatementNode exten
 		throws StandardException
 	{
 
-		TableName	targetTableName = makeTableName
-            (nodeFactory, contextManager, targetTableDescriptor.getSchemaName(), targetTableDescriptor.getName());
+        TableName targetTableName = makeTableName(
+                cm,
+                targetTableDescriptor.getSchemaName(),
+                targetTableDescriptor.getName());
 
 		/* We now have the expression as a query tree.  Now, we prepare
 		 * to bind that query tree to the source's RCL.  That way, the
@@ -727,27 +723,23 @@ abstract class DMLModStatementNode exten
 		 * In this case, the caller of bindConstraints (UpdateNode)
 		 * has chosen to pass in the correct RCL to bind against.
 		 */
-		FromList fakeFromList =
-			(FromList) nodeFactory.getNode(
-							C_NodeTypes.FROM_LIST,
-							nodeFactory.doJoinOrderOptimization(),
-							contextManager);
-		FromBaseTable table = (FromBaseTable)
-			nodeFactory.getNode(
-				C_NodeTypes.FROM_BASE_TABLE,
-				targetTableName,
-				null,
-				sourceRCL,
-				null,
-				contextManager);
+        FromList fakeFromList =
+            new FromList(optimizerFactory.doJoinOrderOptimization(), cm);
+
+        FromBaseTable table = new FromBaseTable(
+                targetTableName,
+                null,
+                sourceRCL,
+                null,
+                cm);
 		table.setTableNumber(0);
 		fakeFromList.addFromTable(table);
 
 		// Now we can do the bind.
-		expression = expression.bindExpression(
-										fakeFromList,
-										(SubqueryList) null,
-										(List<AggregateNode>) null);
+        expression.bindExpression(
+                fakeFromList,
+                (SubqueryList) null,
+                (List<AggregateNode>) null);
 	}
 
 	/**
@@ -827,9 +819,7 @@ abstract class DMLModStatementNode exten
 				parseCheckConstraint(constraintText, td);
 
 			// Put a TestConstraintNode above the constraint tree
-			TestConstraintNode tcn =
-				(TestConstraintNode) getNodeFactory().getNode(
-					C_NodeTypes.TEST_CONSTRAINT_NODE,
+           TestConstraintNode tcn = new TestConstraintNode(
 					oneConstraint,
 					SQLState.LANG_CHECK_CONSTRAINT_VIOLATED,
 					td.getQualifiedName(),
@@ -843,11 +833,7 @@ abstract class DMLModStatementNode exten
 			}
 			else
 			{
-				checkTree = (ValueNode) getNodeFactory().getNode(
-					C_NodeTypes.AND_NODE,
-					tcn,
-					checkTree,
-					getContextManager());
+               checkTree = new AndNode(tcn, checkTree, getContextManager());
 			}
 		}
 
@@ -878,15 +864,15 @@ abstract class DMLModStatementNode exten
 	{
         ArrayList<FKInfo>         fkList = new ArrayList<FKInfo>();
 		int 								type;
-		UUID[] 								uuids = null;
-		long[] 								conglomNumbers = null;
-		String[]							fkNames = null;
+        UUID[]                              uuids;
+        long[]                              conglomNumbers;
+        String[]                            fkNames;
 		ConstraintDescriptorList			fkcdl;
 		ReferencedKeyConstraintDescriptor	refcd;
 		boolean[]							isSelfReferencingFK;
 		ConstraintDescriptorList			activeList = dd.getActiveConstraintDescriptors(cdl);
 		int[]								rowMap = getRowMap(readColsBitSet, td);
-		int[]                               raRules = null;
+        int[]                               raRules;
 		ArrayList<String>              refTableNames = new ArrayList<String>(1);
 		ArrayList<Long>               refIndexConglomNum = new ArrayList<Long>(1);
 		ArrayList<Integer>            refActions = new ArrayList<Integer>(1);
@@ -943,7 +929,6 @@ abstract class DMLModStatementNode exten
 				conglomNumbers = new long[size];
 				isSelfReferencingFK = new boolean[size];
 				raRules = new int[size];
-				ForeignKeyConstraintDescriptor fkcd = null;
 				TableDescriptor fktd;
 				ColumnDescriptorList coldl;
 				int[] refColumns; 
@@ -951,7 +936,8 @@ abstract class DMLModStatementNode exten
 				int[] colArray = remapReferencedColumns(cd, rowMap);
 				for (int inner = 0; inner < size; inner++)
 				{
-					fkcd = (ForeignKeyConstraintDescriptor) fkcdl.elementAt(inner);
+                    ForeignKeyConstraintDescriptor fkcd =
+                        (ForeignKeyConstraintDescriptor) fkcdl.elementAt(inner);
 					fkSetupArrays(dd, fkcd,
 								inner, uuids, conglomNumbers, fkNames,
 								isSelfReferencingFK, raRules);
@@ -961,18 +947,19 @@ abstract class DMLModStatementNode exten
 						//find  the referencing  table Name
 						fktd = fkcd.getTableDescriptor();
 						refTableNames.add(fktd.getSchemaName() + "." + fktd.getName());
-						refActions.add(new Integer(raRules[inner]));
+                        refActions.add(Integer.valueOf(raRules[inner]));
 						//find the referencing column name required for update null.
 						refColumns = fkcd.getReferencedColumns();
 						coldl = fktd.getColumnDescriptorList();
 						ColumnDescriptorList releventColDes = new ColumnDescriptorList();
 						for(int i = 0 ; i < refColumns.length; i++)
 						{
-							cold =(ColumnDescriptor)coldl.elementAt(refColumns[i]-1);
+                            cold = coldl.elementAt(refColumns[i]-1);
 							releventColDes.add(cold);
 						}
 						refColDescriptors.add(releventColDes);
-						refIndexConglomNum.add(new Long(conglomNumbers[inner]));
+                        refIndexConglomNum.add(
+                            Long.valueOf(conglomNumbers[inner]));
 						fkColMap.add(colArray);
 					}
 				}
@@ -1006,7 +993,7 @@ abstract class DMLModStatementNode exten
 		
         // Now convert the list into an array.
         if (!fkList.isEmpty()) {
-            fkInfo = (FKInfo[]) fkList.toArray(new FKInfo[fkList.size()]);
+            fkInfo = fkList.toArray(new FKInfo[fkList.size()]);
         }
 
         // Convert the ref action info lists to arrays.
@@ -1078,7 +1065,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @return the array of fkinfos
 	 */
-	public FKInfo[] getFKInfo()
+    FKInfo[] getFKInfo()
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -1095,7 +1082,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @return the trigger info
 	 */
-	public TriggerInfo getTriggerInfo()
+    TriggerInfo getTriggerInfo()
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -1110,7 +1097,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @return the check constraints, may be null
 	 */
-	public ValueNode getCheckConstraints()
+    ValueNode getCheckConstraints()
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -1324,7 +1311,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @return true/false 
 	 */
-	public boolean requiresDeferredProcessing()
+    boolean requiresDeferredProcessing()
 	{
 		return requiresDeferredProcessing;
 	}
@@ -1350,7 +1337,6 @@ abstract class DMLModStatementNode exten
 		Parser						p;
 		ValueNode					checkTree;
 		LanguageConnectionContext	lcc = getLanguageConnectionContext();
-		CompilerContext 			compilerContext = getCompilerContext();
 
 		/* Get a Statement to pass to the parser */
 
@@ -1643,6 +1629,7 @@ abstract class DMLModStatementNode exten
    *
    * @exception StandardException         Thrown on failure
    */
+    @Override
 	public void optimizeStatement() throws StandardException
 	{
 		/* First optimize the query */
@@ -1761,7 +1748,7 @@ abstract class DMLModStatementNode exten
 
 	protected	void	markAffectedIndexes
 	(
-		List	affectedConglomerates
+        List<ConglomerateDescriptor> affectedConglomerates
     )
 		throws StandardException
 	{
@@ -1775,7 +1762,7 @@ abstract class DMLModStatementNode exten
 
 		for ( int ictr = 0; ictr < indexCount; ictr++ )
 		{
-			cd = (ConglomerateDescriptor) affectedConglomerates.get( ictr );
+            cd = affectedConglomerates.get( ictr );
 
 			indicesToMaintain[ ictr ] = cd.getIndexDescriptor();
 			indexConglomerateNumbers[ ictr ] = cd.getConglomerateNumber();
@@ -1788,7 +1775,7 @@ abstract class DMLModStatementNode exten
 	}
 
 
-	public String statementToString()
+    String statementToString()
 	{
 		return "DML MOD";
 	}
@@ -1851,6 +1838,7 @@ abstract class DMLModStatementNode exten
 	}
 
 
+    @Override
     void setRefActionInfo(long fkIndexConglomId,
 								 int[]fkColArray, 
 								 String parentResultSetId,
@@ -1870,7 +1858,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void normalizeSynonymColumns( 
+    void normalizeSynonymColumns(
     ResultColumnList    rcl, 
     TableName           targetTableName)
 		throws StandardException
@@ -1913,8 +1901,8 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @param depth		The depth of this node in the tree
 	 */
-
-	public void printSubNodes(int depth)
+    @Override
+    void printSubNodes(int depth)
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -1938,6 +1926,7 @@ abstract class DMLModStatementNode exten
 	 *
 	 * @exception StandardException on error
 	 */
+    @Override
 	void acceptChildren(Visitor v)
 		throws StandardException
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLStatementNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLStatementNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLStatementNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DMLStatementNode.java Fri Jun 21 07:47:47 2013
@@ -22,12 +22,11 @@
 package	org.apache.derby.impl.sql.compile;
 
 import java.util.List;
-
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.context.ContextManager;
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.sql.ResultColumnDescriptor;
 import org.apache.derby.iapi.sql.ResultDescription;
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.Visitor;
 import org.apache.derby.iapi.sql.conn.Authorizer;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
@@ -65,17 +64,10 @@ abstract class DMLStatementNode extends 
 	 */
 	ResultSetNode	resultSet;
 
-	/**
-	 * Initializer for a DMLStatementNode
-	 *
-	 * @param resultSet	A ResultSetNode for the result set of the
-	 *			DML statement
-	 */
-
-	public void init(Object resultSet)
-	{
-		this.resultSet = (ResultSetNode) resultSet;
-	}
+    DMLStatementNode(ResultSetNode resultSet, ContextManager cm) {
+        super(cm);
+        this.resultSet = resultSet;
+    }
 
 	/**
 	 * Prints the sub-nodes of this object.  See QueryTreeNode.java for
@@ -83,8 +75,8 @@ abstract class DMLStatementNode extends 
 	 *
 	 * @param depth		The depth of this node in the tree
 	 */
-
-	public void printSubNodes(int depth)
+    @Override
+    void printSubNodes(int depth)
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -103,7 +95,7 @@ abstract class DMLStatementNode extends 
 	 *
 	 * @return ResultSetNode	The ResultSetNode from this DMLStatementNode.
 	 */
-	public ResultSetNode getResultSetNode()
+    ResultSetNode getResultSetNode()
 	{
 		return resultSet;
 	}
@@ -161,7 +153,7 @@ abstract class DMLStatementNode extends 
 	 * @exception StandardException		Thrown on error
 	 */
 
-	public QueryTreeNode bindResultSetsWithTables(DataDictionary dataDictionary)
+    QueryTreeNode bindResultSetsWithTables(DataDictionary dataDictionary)
 					 throws StandardException
 	{
 		/* Okay to bindly bind the tables, since ResultSets without tables
@@ -193,18 +185,11 @@ abstract class DMLStatementNode extends 
 		 * > 0 because the nodes are create for dependent tables also in the 
 		 * the same context.
 		 */
-
-		resultSet = resultSet.bindNonVTITables(
-						dataDictionary,
-						(FromList) getNodeFactory().getNode(
-							C_NodeTypes.FROM_LIST,
-							getNodeFactory().doJoinOrderOptimization(),
-							getContextManager()));
-		resultSet = resultSet.bindVTITables(
-						(FromList) getNodeFactory().getNode(
-							C_NodeTypes.FROM_LIST,
-							getNodeFactory().doJoinOrderOptimization(),
-							getContextManager()));
+        boolean doJOO = getOptimizerFactory().doJoinOrderOptimization();
+        ContextManager cm = getContextManager();
+        resultSet = resultSet.bindNonVTITables(dataDictionary,
+                                               new FromList(doJOO, cm));
+        resultSet = resultSet.bindVTITables(new FromList(doJOO, cm));
 	}
 
 	/**
@@ -216,10 +201,9 @@ abstract class DMLStatementNode extends 
 	protected void bindExpressions()
 			throws StandardException
 	{
-		FromList fromList = (FromList) getNodeFactory().getNode(
-								C_NodeTypes.FROM_LIST,
-								getNodeFactory().doJoinOrderOptimization(),
-								getContextManager());
+        FromList fromList =
+                new FromList(getOptimizerFactory().doJoinOrderOptimization(),
+                             getContextManager());
 
 		/* Bind the expressions under the resultSet */
 		resultSet.bindExpressions(fromList);
@@ -240,10 +224,9 @@ abstract class DMLStatementNode extends 
 	protected void bindExpressionsWithTables()
 			throws StandardException
 	{
-		FromList fromList = (FromList) getNodeFactory().getNode(
-								C_NodeTypes.FROM_LIST,
-								getNodeFactory().doJoinOrderOptimization(),
-								getContextManager());
+        FromList fromList =
+                new FromList(getOptimizerFactory().doJoinOrderOptimization(),
+                             getContextManager());
 
 		/* Bind the expressions under the resultSet */
 		resultSet.bindExpressionsWithTables(fromList);
@@ -265,7 +248,8 @@ abstract class DMLStatementNode extends 
 	 */
 	int activationKind()
 	{
-		List parameterList = getCompilerContext().getParameterList();
+        List<ParameterNode> parameterList =
+            getCompilerContext().getParameterList();
 		/*
 		** We need rows for all types of DML activations.  We need parameters
 		** only for those that have parameters.
@@ -295,6 +279,7 @@ abstract class DMLStatementNode extends 
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
 	public void optimizeStatement() throws StandardException
 	{
 		resultSet = resultSet.preprocess(getCompilerContext().getNumTables(),
@@ -338,13 +323,9 @@ abstract class DMLStatementNode extends 
 			siRCList.genVirtualColumnNodes(resultSet, childRCList);
 
 			/* Finally, we create the new ScrollInsensitiveResultSetNode */
-			resultSet = (ResultSetNode) getNodeFactory().
-							getNode(
-								C_NodeTypes.SCROLL_INSENSITIVE_RESULT_SET_NODE,
-								resultSet, 
-								siRCList,
-								null,
-								getContextManager());
+            resultSet = new ScrollInsensitiveResultSetNode(
+                    resultSet, siRCList, null, getContextManager());
+
 			// Propagate the referenced table map if it's already been created
 			if (siChild.getReferencedTableMap() != null)
 			{
@@ -368,7 +349,7 @@ abstract class DMLStatementNode extends 
 	 *
 	 * @return	A ResultDescription for this DML statement
 	 */
-
+    @Override
 	public ResultDescription makeResultDescription()
 	{
 	    ResultColumnDescriptor[] colDescs = resultSet.makeResultDescriptors();
@@ -390,7 +371,8 @@ abstract class DMLStatementNode extends 
 	void generateParameterValueSet(ActivationClassBuilder acb)
 		throws StandardException
 	{
-		List parameterList = getCompilerContext().getParameterList();
+        List<ParameterNode> parameterList =
+            getCompilerContext().getParameterList();
 		int	numberOfParameters = (parameterList == null) ? 0 : parameterList.size();
 
 		if (numberOfParameters <= 0)
@@ -416,6 +398,7 @@ abstract class DMLStatementNode extends 
 	 *
 	 * @exception StandardException on error
 	 */	
+    @Override
 	public boolean isAtomic() throws StandardException
 	{
 		/*
@@ -443,6 +426,7 @@ abstract class DMLStatementNode extends 
 	 *
 	 * @exception StandardException on error
 	 */
+    @Override
 	void acceptChildren(Visitor v)
 		throws StandardException
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DateTypeCompiler.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DateTypeCompiler.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DateTypeCompiler.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DateTypeCompiler.java Fri Jun 21 07:47:47 2013
@@ -21,24 +21,14 @@
 
 package org.apache.derby.impl.sql.compile;
 
+import java.sql.Types;
+import org.apache.derby.iapi.reference.ClassName;
 import org.apache.derby.iapi.services.loader.ClassFactory;
-
-import org.apache.derby.iapi.error.StandardException;
-
+import org.apache.derby.iapi.sql.compile.TypeCompiler;
 import org.apache.derby.iapi.types.DataTypeDescriptor;
-import org.apache.derby.iapi.types.DateTimeDataValue;
-import org.apache.derby.iapi.types.DataValueFactory;
 import org.apache.derby.iapi.types.TypeId;
 
-import org.apache.derby.iapi.sql.compile.TypeCompiler;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.iapi.reference.ClassName;
-
-import java.sql.Types;
-
-public class DateTypeCompiler extends BaseTypeCompiler
+class DateTypeCompiler extends BaseTypeCompiler
 {
 	/* TypeCompiler methods */
 	/**

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DefaultNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DefaultNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DefaultNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DefaultNode.java Fri Jun 21 07:47:47 2013
@@ -22,26 +22,20 @@
 package	org.apache.derby.impl.sql.compile;
 
 import java.util.List;
+import org.apache.derby.catalog.types.DefaultInfoImpl;
+import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.services.compiler.MethodBuilder;
-
+import org.apache.derby.iapi.services.context.ContextManager;
 import org.apache.derby.iapi.services.sanity.SanityManager;
-
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.compile.Parser;
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.Visitable;
-
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
-
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DefaultDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.catalog.types.DefaultInfoImpl;
-
-
 /**
  * DefaultNode represents a column/parameter default.
  */
@@ -52,26 +46,39 @@ public  class DefaultNode extends ValueN
 	private ValueNode	defaultTree;
 
 	/**
-	 * Initializer for a column/parameter default.
+     * Constructor for a generated by default as identity column.
+     *
+     * @param cm            The context manager
+     */
+    DefaultNode(ContextManager cm) {
+        super(cm);
+        setNodeType(C_NodeTypes.DEFAULT_NODE);
+    }
+
+    /**
+     * Constructor for a column/parameter default.
 	 *
-	 * @param defaultTree			Query tree for default
+     * @param defaultTree   Query tree for default
 	 * @param defaultText	The text of the default.
+     * @param cm            The context manager
 	 */
-	public void init(
-					Object defaultTree,
-					Object defaultText)
-	{
-		this.defaultTree = (ValueNode) defaultTree;
-		this.defaultText = (String) defaultText;
+    DefaultNode(ValueNode defaultTree,
+                String defaultText,
+                ContextManager cm) {
+        super(cm);
+        setNodeType(C_NodeTypes.DEFAULT_NODE);
+        this.defaultTree = defaultTree;
+        this.defaultText = defaultText;
 	}
 
 	/**
-	 * Initializer for insert/update
-	 *
+     * Constructor for insert/update
+     * @param columnName The column name for which a default is to be applied
 	 */
-	public void init(Object columnName)
-	{
-		this.columnName = (String) columnName;
+    DefaultNode(String columnName, ContextManager cm) {
+        super(cm);
+        setNodeType(C_NodeTypes.DEFAULT_NODE);
+        this.columnName = columnName;
 	}
 
 	/**
@@ -98,7 +105,7 @@ public  class DefaultNode extends ValueN
 	 *
 	 * @return	This object as a String
 	 */
-
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG)
@@ -119,7 +126,8 @@ public  class DefaultNode extends ValueN
 	 *
 	 * @param depth		The depth of this node in the tree
 	 */
-	public void printSubNodes(int depth)
+    @Override
+    void printSubNodes(int depth)
 	{
 		if (SanityManager.DEBUG)
 		{
@@ -148,6 +156,7 @@ public  class DefaultNode extends ValueN
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
+    @Override
     ValueNode bindExpression(FromList fromList, SubqueryList subqueryList, List<AggregateNode> aggregates)
 		throws StandardException
 	{
@@ -183,16 +192,18 @@ public  class DefaultNode extends ValueN
 		DefaultInfoImpl defaultInfo = (DefaultInfoImpl) cd.getDefaultInfo();
 		if (defaultInfo != null)
 		{
-			String		defaultText = defaultInfo.getDefaultText();
-			ValueNode	defaultTree = parseDefault(defaultText, getLanguageConnectionContext(),
-												   getCompilerContext());
+            String      defaultTxt = defaultInfo.getDefaultText();
+            ValueNode   defaultTre = parseDefault(
+                defaultTxt,
+                getLanguageConnectionContext(),
+                getCompilerContext());
 
 			/* Query is dependent on the DefaultDescriptor */
 			DefaultDescriptor defaultDescriptor = cd.getDefaultDescriptor(
 													getDataDictionary());
 			getCompilerContext().createDependency(defaultDescriptor);
 
-			return defaultTree.bindExpression(
+            return defaultTre.bindExpression(
 									fromList, 
 									subqueryList,
                                     aggregates);
@@ -200,10 +211,7 @@ public  class DefaultNode extends ValueN
 		else
 		{
 			// Default is null
-			ValueNode nullNode = (ValueNode) getNodeFactory().getNode(
-										C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
-										getContextManager());
-			return nullNode;
+            return new UntypedNullConstantNode(getContextManager());
 		}
 	}
 
@@ -279,6 +287,7 @@ public  class DefaultNode extends ValueN
 	/**
 	 * @exception StandardException		Thrown on failure
 	 */
+    @Override
     void generateExpression(ExpressionClassBuilder acb, MethodBuilder mb)
 		throws StandardException
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DefaultOptTrace.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DefaultOptTrace.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DefaultOptTrace.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DefaultOptTrace.java Fri Jun 21 07:47:47 2013
@@ -22,15 +22,14 @@
 package org.apache.derby.impl.sql.compile;
 
 import java.io.PrintWriter;
-
 import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.sql.compile.AccessPath;
 import org.apache.derby.iapi.sql.compile.CostEstimate;
 import org.apache.derby.iapi.sql.compile.JoinStrategy;
+import org.apache.derby.iapi.sql.compile.OptTrace;
 import org.apache.derby.iapi.sql.compile.Optimizable;
 import org.apache.derby.iapi.sql.compile.OptimizableList;
 import org.apache.derby.iapi.sql.compile.Optimizer;
-import org.apache.derby.iapi.sql.compile.OptTrace;
 import org.apache.derby.iapi.sql.compile.RequiredRowOrdering;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;
@@ -54,7 +53,7 @@ public  class   DefaultOptTrace implemen
     //
     ////////////////////////////////////////////////////////////////////////
 
-    private StringBuffer    _buffer;
+    private StringBuilder _buffer;
     
     ////////////////////////////////////////////////////////////////////////
     //
@@ -65,7 +64,7 @@ public  class   DefaultOptTrace implemen
     /** Make a DefaultOptTrace */
     public  DefaultOptTrace()
     {
-        _buffer = new StringBuffer();
+        _buffer = new StringBuilder();
     }
 
     ////////////////////////////////////////////////////////////////////////
@@ -500,7 +499,7 @@ public  class   DefaultOptTrace implemen
          JBitSet    assignedTableMap
          )
 	{
-		StringBuffer joinOrderString = new StringBuffer();
+        StringBuilder joinOrderString = new StringBuilder();
         joinOrderString.append(prefix);
 
 		for (int i = 0; i <= joinPosition; i++)
@@ -563,7 +562,8 @@ public  class   DefaultOptTrace implemen
     /** Append a string to the optimizer trace */
     private void    appendTraceString( String traceString )
     {
-		_buffer.append( traceString + "\n" );
+        _buffer.append( traceString );
+        _buffer.append( "\n" );
     }
 
 }

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DeleteNode.java Fri Jun 21 07:47:47 2013
@@ -21,52 +21,39 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.reference.SQLState;
+import java.lang.reflect.Modifier;
+import java.util.ArrayList;
+import java.util.HashSet;
+import java.util.Iterator;
+import java.util.List;
+import java.util.Properties;
+import org.apache.derby.catalog.UUID;
 import org.apache.derby.iapi.error.StandardException;
-
+import org.apache.derby.iapi.reference.ClassName;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.classfile.VMOpcode;
+import org.apache.derby.iapi.services.compiler.LocalField;
+import org.apache.derby.iapi.services.compiler.MethodBuilder;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.io.FormatableBitSet;
+import org.apache.derby.iapi.services.io.FormatableProperties;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.ResultDescription;
+import org.apache.derby.iapi.sql.StatementType;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.conn.Authorizer;
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ColumnDescriptorList;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
+import org.apache.derby.iapi.sql.dictionary.DataDictionary;
+import org.apache.derby.iapi.sql.dictionary.GenericDescriptorList;
+import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
-
-import org.apache.derby.iapi.sql.StatementType;
-
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
-import org.apache.derby.iapi.reference.ClassName;
-
 import org.apache.derby.iapi.sql.execute.ConstantAction;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
-import org.apache.derby.iapi.services.compiler.MethodBuilder;
-
 import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo;
 import org.apache.derby.iapi.store.access.TransactionController;
-
-import org.apache.derby.vti.DeferModification;
-
-import org.apache.derby.catalog.UUID;
-import org.apache.derby.iapi.services.io.FormatableBitSet;
-
-import org.apache.derby.impl.sql.execute.FKInfo;
-
-import java.lang.reflect.Modifier;
-import org.apache.derby.iapi.services.classfile.VMOpcode;
-import org.apache.derby.iapi.services.io.FormatableProperties;
-
-import java.util.ArrayList;
-import java.util.HashSet;
-import java.util.Iterator;
-import java.util.List;
-import java.util.Properties;
-import org.apache.derby.iapi.sql.compile.NodeFactory;
 import org.apache.derby.iapi.util.ReuseFactory;
-import org.apache.derby.iapi.sql.ResultDescription;
-import org.apache.derby.iapi.services.compiler.LocalField;
+import org.apache.derby.vti.DeferModification;
 
 
 /**
@@ -78,8 +65,7 @@ import org.apache.derby.iapi.services.co
  * the named cursor.
  *
  */
-
-public class DeleteNode extends DMLModStatementNode
+class DeleteNode extends DMLModStatementNode
 {
 	/* Column name for the RowLocation column in the ResultSet */
 	private static final String COLUMNNAME = "###RowLocationToDelete";
@@ -94,21 +80,24 @@ public class DeleteNode extends DMLModSt
 	private StatementNode[] dependentNodes;
 
 	/**
-	 * Initializer for a DeleteNode.
+     * Constructor for a DeleteNode.
 	 *
 	 * @param targetTableName	The name of the table to delete from
 	 * @param queryExpression	The query expression that will generate
 	 *				the rows to delete from the given table
+     * @param cm                The context manager
 	 */
 
-	public void init(Object targetTableName,
-					  Object queryExpression)
-	{
-		super.init(queryExpression);
-		this.targetTableName = (TableName) targetTableName;
+    DeleteNode(TableName targetTableName,
+               ResultSetNode queryExpression,
+               ContextManager cm) {
+        super(queryExpression, cm);
+        setNodeType(C_NodeTypes.DELETE_NODE);
+        this.targetTableName = targetTableName;
 	}
 
-	public String statementToString()
+    @Override
+    String statementToString()
 	{
 		return "DELETE";
 	}
@@ -128,18 +117,18 @@ public class DeleteNode extends DMLModSt
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-
+    @Override
 	public void bindStatement() throws StandardException
 	{
 		// We just need select privilege on the where clause tables
 		getCompilerContext().pushCurrentPrivType( Authorizer.SELECT_PRIV);
 		try
 		{
-			FromList	fromList = (FromList) getNodeFactory().getNode(
-									C_NodeTypes.FROM_LIST,
-									getNodeFactory().doJoinOrderOptimization(),
-									getContextManager());
-			ResultColumn				rowLocationColumn = null;
+            FromList fromList = new FromList(
+                    getOptimizerFactory().doJoinOrderOptimization(),
+                    getContextManager());
+
+            ResultColumn                rowLocationColumn = null;
 			CurrentRowLocationNode		rowLocationNode;
 			TableName					cursorTargetTableName = null;
 			CurrentOfNode       		currentOfNode = null;
@@ -156,8 +145,7 @@ public class DeleteNode extends DMLModSt
 				SanityManager.ASSERT(resultSet != null && resultSet instanceof SelectNode,
 				"Delete must have a select result set");
 
-			SelectNode sel;
-			sel = (SelectNode)resultSet;
+            SelectNode sel = (SelectNode)resultSet;
 			targetTable = (FromTable) sel.fromList.elementAt(0);
 			if (targetTable instanceof CurrentOfNode)
 			{
@@ -226,7 +214,8 @@ public class DeleteNode extends DMLModSt
 				** are needed in the rcl.
 				*/
 
-				resultColumnList = new ResultColumnList();
+                resultColumnList =
+                        new ResultColumnList(getContextManager());
 
 				FromBaseTable fbt = getResultColumnList(resultColumnList);
 
@@ -255,15 +244,12 @@ public class DeleteNode extends DMLModSt
 				}
 
 				/* Generate the RowLocation column */
-				rowLocationNode = (CurrentRowLocationNode) getNodeFactory().getNode(
-										C_NodeTypes.CURRENT_ROW_LOCATION_NODE,
-										getContextManager());
-				rowLocationColumn =
-					(ResultColumn) getNodeFactory().getNode(
-									C_NodeTypes.RESULT_COLUMN,
-									COLUMNNAME,
-									rowLocationNode,
-									getContextManager());
+                rowLocationNode =
+                        new CurrentRowLocationNode(getContextManager());
+                rowLocationColumn =
+                        new ResultColumn(COLUMNNAME,
+                                         rowLocationNode,
+                                         getContextManager());
 				rowLocationColumn.markGenerated();
 
 				/* Append to the ResultColumnList */
@@ -289,7 +275,7 @@ public class DeleteNode extends DMLModSt
 				rowLocationColumn.bindResultColumnToExpression();
 
 				bindConstraints(dataDictionary,
-							getNodeFactory(),
+                            getOptimizerFactory(),
 							targetTableDescriptor,
 							null,
 							resultColumnList,
@@ -318,7 +304,6 @@ public class DeleteNode extends DMLModSt
                                                   null,
                                                   sel.getWhereClause());
 			}
-        	sel = null; // done with sel
 
 			/* Verify that all underlying ResultSets reclaimed their FromList */
 			if (SanityManager.DEBUG)
@@ -383,6 +368,7 @@ public class DeleteNode extends DMLModSt
 		}
 	} // end of bind
 
+    @Override
 	int getPrivType()
 	{
 		return Authorizer.DELETE_PRIV;
@@ -395,6 +381,7 @@ public class DeleteNode extends DMLModSt
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
 	public boolean referencesSessionSchema()
 		throws StandardException
 	{
@@ -407,7 +394,8 @@ public class DeleteNode extends DMLModSt
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public ConstantAction	makeConstantAction() throws StandardException
+    @Override
+    public ConstantAction makeConstantAction() throws StandardException
 	{
 
 		/* Different constant actions for base tables and updatable VTIs */
@@ -500,6 +488,7 @@ public class DeleteNode extends DMLModSt
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
     void generate(ActivationClassBuilder acb, MethodBuilder mb)
 							throws StandardException
 	{
@@ -654,6 +643,7 @@ public class DeleteNode extends DMLModSt
 	 *
 	 * @return the type of statement
 	 */
+    @Override
 	protected final int getStatementType()
 	{
 		return StatementType.DELETE;
@@ -743,18 +733,17 @@ public class DeleteNode extends DMLModSt
 
         ValueNode whereClause = null;
 
-        TableName tableName = new TableName();
-        tableName.init(schemaName , targetTableName);
+        TableName tableName =
+            new TableName(schemaName , targetTableName, getContextManager());
+
+        FromList fromList = new FromList(getContextManager());
 
-        NodeFactory nodeFactory = getNodeFactory();
-        FromList   fromList = (FromList) nodeFactory.getNode(C_NodeTypes.FROM_LIST, getContextManager());
-        FromTable fromTable = (FromTable) nodeFactory.getNode(
-                                                    C_NodeTypes.FROM_BASE_TABLE,
-                                                    tableName,
-                                                    null,
-                                                    ReuseFactory.getInteger(FromBaseTable.DELETE),
-                                                    null,
-                                                    getContextManager());
+        FromTable fromTable = new FromBaseTable(
+                tableName,
+                null,
+                FromBaseTable.DELETE,
+                null,
+                getContextManager());
 
 		//we would like to use references index & table scan instead of 
 		//what optimizer says for the dependent table scan.
@@ -763,21 +752,15 @@ public class DeleteNode extends DMLModSt
 		((FromBaseTable) fromTable).setTableProperties(targetProperties);
 
         fromList.addFromTable(fromTable);
-        SelectNode resultSet = (SelectNode) nodeFactory.getNode(
-                                                     C_NodeTypes.SELECT_NODE,
-                                                     null,
-                                                     fromList, /* FROM list */
-                                                     whereClause, /* WHERE clause */
-                                                     null, /* GROUP BY list */
-                                                     null, /* having clause */
-													 null, /* windows */
-													 getContextManager());
-
-        return (DeleteNode) nodeFactory.getNode(
-                                                    C_NodeTypes.DELETE_NODE,
-                                                    tableName,
-                                                    resultSet,
-                                                    getContextManager());
+        SelectNode rs = new SelectNode(null,
+                                       fromList, /* FROM list */
+                                       whereClause, /* WHERE clause */
+                                       null, /* GROUP BY list */
+                                       null, /* having clause */
+                                       null, /* windows */
+                                       getContextManager());
+
+        return new DeleteNode(tableName, rs, getContextManager());
 
     }
 
@@ -791,18 +774,17 @@ public class DeleteNode extends DMLModSt
 
         ValueNode whereClause = null;
 
-        TableName tableName = new TableName();
-        tableName.init(schemaName , targetTableName);
+        TableName tableName =
+            new TableName(schemaName , targetTableName, getContextManager());
+
+        FromList fromList = new FromList(getContextManager());
 
-        NodeFactory nodeFactory = getNodeFactory();
-        FromList   fromList = (FromList) nodeFactory.getNode(C_NodeTypes.FROM_LIST, getContextManager());
-        FromTable fromTable = (FromTable) nodeFactory.getNode(
-                                                    C_NodeTypes.FROM_BASE_TABLE,
-                                                    tableName,
-                                                    null,
-                                                    ReuseFactory.getInteger(FromBaseTable.DELETE),
-                                                    null,
-                                                    getContextManager());
+        FromTable fromTable = new FromBaseTable(
+                tableName,
+                null,
+                ReuseFactory.getInteger(FromBaseTable.DELETE),
+                null,
+                getContextManager());
 
 
 		//we would like to use references index & table scan instead of 
@@ -813,52 +795,38 @@ public class DeleteNode extends DMLModSt
 
         fromList.addFromTable(fromTable);
 
-        SelectNode resultSet = (SelectNode) nodeFactory.getNode(
-                                                     C_NodeTypes.SELECT_NODE,
-                                                     getSetClause(tableName, cdl),
-                                                     fromList, /* FROM list */
-                                                     whereClause, /* WHERE clause */
-                                                     null, /* GROUP BY list */
-													 null, /* having clause */
-													 null, /* windows */
-                                                     getContextManager());
-
-        return (UpdateNode) nodeFactory.getNode(
-                                                    C_NodeTypes.UPDATE_NODE,
-                                                    tableName,
-                                                    resultSet,
-                                                    getContextManager());
+        SelectNode resultSet = new SelectNode(getSetClause(cdl),
+                                              fromList, /* FROM list */
+                                              whereClause, /* WHERE clause */
+                                              null, /* GROUP BY list */
+                                              null, /* having clause */
+                                              null, /* windows */
+                                              getContextManager());
+
+        return new UpdateNode(tableName, resultSet, getContextManager());
 
     }
 
 
  
-	private ResultColumnList getSetClause(TableName tabName,
-										  ColumnDescriptorList cdl)
+    private ResultColumnList getSetClause(ColumnDescriptorList cdl)
 		throws StandardException
 	{
 		ResultColumn resultColumn;
 		ValueNode	 valueNode;
 
-		NodeFactory nodeFactory = getNodeFactory();
-		ResultColumnList	columnList = (ResultColumnList) nodeFactory.getNode(
-												C_NodeTypes.RESULT_COLUMN_LIST,
-												getContextManager());
+        ResultColumnList columnList = new ResultColumnList(getContextManager());
 
-		valueNode =  (ValueNode) nodeFactory.getNode(C_NodeTypes.UNTYPED_NULL_CONSTANT_NODE,
-															 getContextManager());
+        valueNode = new UntypedNullConstantNode(getContextManager());
 		for(int index =0 ; index < cdl.size() ; index++)
 		{
-			ColumnDescriptor cd = (ColumnDescriptor) cdl.elementAt(index);
+            ColumnDescriptor cd = cdl.elementAt(index);
 			//only columns that are nullable need to be set to 'null' for ON
 			//DELETE SET NULL
 			if((cd.getType()).isNullable())
 			{
-				resultColumn = (ResultColumn) nodeFactory.getNode(
-   									    C_NodeTypes.RESULT_COLUMN,
-										cd,
-										valueNode,
-										getContextManager());
+                resultColumn =
+                        new ResultColumn(cd, valueNode, getContextManager());
 
 				columnList.addResultColumn(resultColumn);
 			}
@@ -866,7 +834,7 @@ public class DeleteNode extends DMLModSt
 		return columnList;
 	}
 
-
+    @Override
 	public void optimizeStatement() throws StandardException
 	{
 		if(cascadeDelete)

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DistinctNode.java Fri Jun 21 07:47:47 2013
@@ -22,32 +22,26 @@
 package	org.apache.derby.impl.sql.compile;
 
 import java.util.List;
-
+import java.util.Properties;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.ClassName;
+import org.apache.derby.iapi.services.classfile.VMOpcode;
+import org.apache.derby.iapi.services.compiler.MethodBuilder;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
+import org.apache.derby.iapi.sql.compile.CostEstimate;
 import org.apache.derby.iapi.sql.compile.Optimizable;
 import org.apache.derby.iapi.sql.compile.OptimizablePredicate;
 import org.apache.derby.iapi.sql.compile.OptimizablePredicateList;
 import org.apache.derby.iapi.sql.compile.Optimizer;
-import org.apache.derby.iapi.sql.compile.CostEstimate;
 import org.apache.derby.iapi.sql.compile.RequiredRowOrdering;
 import org.apache.derby.iapi.sql.compile.RowOrdering;
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
-
-import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
-
-import org.apache.derby.iapi.reference.ClassName;
-
-import org.apache.derby.iapi.services.classfile.VMOpcode;
-
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.services.compiler.MethodBuilder;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
+import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 
 /**
- * A DistinctNode represents a result set for a disinct operation
+ * A DistinctNode represents a result set for a distinct operation
  * on a select.  It has the same description as its input result set.
  *
  * For the most part, it simply delegates operations to its childResultSet,
@@ -57,26 +51,28 @@ import org.apache.derby.iapi.services.sa
  * NOTE: A DistinctNode extends FromTable since it can exist in a FromList.
  *
  */
-public class DistinctNode extends SingleChildResultSetNode
+class DistinctNode extends SingleChildResultSetNode
 {
 	boolean inSortedOrder;
 
 	/**
-	 * Initializer for a DistinctNode.
+     * Constructor for a DistinctNode.
 	 *
 	 * @param childResult	The child ResultSetNode
 	 * @param inSortedOrder	Whether or not the child ResultSetNode returns its
 	 *						output in sorted order.
 	 * @param tableProperties	Properties list associated with the table
+     * @param cm            The context manager
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-	public void init(
-						Object childResult,
-						Object inSortedOrder,
-						Object tableProperties) throws StandardException
+    DistinctNode(ResultSetNode childResult,
+                 boolean inSortedOrder,
+                 Properties tableProperties,
+                 ContextManager cm) throws StandardException
 	{
-		super.init(childResult, tableProperties);
+        super(childResult, tableProperties, cm);
+        setNodeType(C_NodeTypes.DISTINCT_NODE);
 
 		if (SanityManager.DEBUG)
 		{
@@ -92,8 +88,6 @@ public class DistinctNode extends Single
 			}
 		}
 
-		ResultColumnList prRCList;
-
 		/*
 			We want our own resultColumns, which are virtual columns
 			pointing to the child result's columns.
@@ -105,22 +99,22 @@ public class DistinctNode extends Single
 		/* We get a shallow copy of the ResultColumnList and its 
 		 * ResultColumns.  (Copy maintains ResultColumn.expression for now.)
 		 */
-		prRCList = this.childResult.getResultColumns().copyListAndObjects();
-		resultColumns = this.childResult.getResultColumns();
+        final ResultColumnList prRCList =
+                this.childResult.getResultColumns().copyListAndObjects();
+        this.resultColumns = this.childResult.getResultColumns();
 		this.childResult.setResultColumns(prRCList);
 
 		/* Replace ResultColumn.expression with new VirtualColumnNodes
 		 * in the DistinctNode's RCL.  (VirtualColumnNodes include
 		 * pointers to source ResultSetNode, this, and source ResultColumn.)
 		 */
-		resultColumns.genVirtualColumnNodes(this, prRCList);
+        this.resultColumns.genVirtualColumnNodes(this, prRCList);
 
 		/* Verify that we can perform a DISTINCT on the
 		 * underlying tree.
 		 */
-		resultColumns.verifyAllOrderable();
-
-		this.inSortedOrder = ((Boolean) inSortedOrder).booleanValue();
+        this.resultColumns.verifyAllOrderable();
+        this.inSortedOrder = inSortedOrder;
 	}
 
 	/*
@@ -132,17 +126,17 @@ public class DistinctNode extends Single
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
 	public CostEstimate optimizeIt(Optimizer optimizer,
 									OptimizablePredicateList predList,
 									CostEstimate outerCost,
 									RowOrdering rowOrdering)
 			throws StandardException
 	{
-		CostEstimate childCost =
-			((Optimizable) childResult).optimizeIt(optimizer,
-									predList,
-									outerCost,
-									rowOrdering);
+        ((Optimizable) childResult).optimizeIt(optimizer,
+                predList,
+                outerCost,
+                rowOrdering);
 
 		return super.optimizeIt(optimizer, predList, outerCost, rowOrdering);
 	}
@@ -152,6 +146,7 @@ public class DistinctNode extends Single
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
 	public CostEstimate estimateCost(OptimizablePredicateList predList,
 									ConglomerateDescriptor cd,
 									CostEstimate outerCost,
@@ -186,7 +181,7 @@ public class DistinctNode extends Single
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-
+    @Override
 	public boolean pushOptPredicate(OptimizablePredicate optimizablePredicate)
 			throws StandardException
 	{
@@ -207,8 +202,8 @@ public class DistinctNode extends Single
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-
-	public ResultSetNode optimize(DataDictionary dataDictionary,
+    @Override
+    ResultSetNode optimize(DataDictionary dataDictionary,
 								  PredicateList predicates,
 								  double outerRows) 
 					throws StandardException
@@ -216,14 +211,12 @@ public class DistinctNode extends Single
 		/* We need to implement this method since a PRN can appear above a
 		 * SelectNode in a query tree.
 		 */
-		childResult = (ResultSetNode) childResult.optimize(
-															dataDictionary,
-															predicates,
-															outerRows);
-		Optimizer optimizer = getOptimizer(
-						(FromList) getNodeFactory().getNode(
-							C_NodeTypes.FROM_LIST,
-							getNodeFactory().doJoinOrderOptimization(),
+        childResult = childResult.optimize(dataDictionary,
+                                           predicates,
+                                           outerRows);
+        Optimizer opt = getOptimizer(
+                        new FromList(
+                            getOptimizerFactory().doJoinOrderOptimization(),
 							this,
 							getContextManager()),
 						predicates,
@@ -232,7 +225,7 @@ public class DistinctNode extends Single
 
 		// RESOLVE: NEED TO FACTOR IN COST OF SORTING AND FIGURE OUT HOW
 		// MANY ROWS HAVE BEEN ELIMINATED.
-		costEstimate = optimizer.newCostEstimate();
+        costEstimate = opt.newCostEstimate();
 
 		costEstimate.setCost(childResult.getCostEstimate().getEstimatedCost(),
 							 childResult.getCostEstimate().rowCount(),
@@ -254,7 +247,10 @@ public class DistinctNode extends Single
 	 * @return	Whether the underlying ResultSet tree
 	 * is ordered on the specified column.
 	 */
-    boolean isOrderedOn(ColumnReference[] crs, boolean permuteOrdering, List fbtHolder)
+    @Override
+    boolean isOrderedOn(ColumnReference[] crs,
+                        boolean permuteOrdering,
+                        List<FromBaseTable> fbtHolder)
 	{
 		/* RESOLVE - DistinctNodes are ordered on their RCLs.
 		 * Walk RCL to see if cr is 1st non-constant column in the
@@ -265,10 +261,11 @@ public class DistinctNode extends Single
 
     /**
      * generate the distinct result set operating over the source
-	 * resultset.
+     * result set.
      *
 	 * @exception StandardException		Thrown on error
      */
+    @Override
     void generate(ActivationClassBuilder acb, MethodBuilder mb)
 							throws StandardException
 	{

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropAliasNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropAliasNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropAliasNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropAliasNode.java Fri Jun 21 07:47:47 2013
@@ -21,49 +21,42 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.sql.compile.C_NodeTypes;
-
-import org.apache.derby.iapi.services.context.ContextManager;
-
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-
-import org.apache.derby.iapi.reference.SQLState;
-
+import org.apache.derby.catalog.AliasInfo;
 import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.services.monitor.Monitor;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.context.ContextManager;
 import org.apache.derby.iapi.services.sanity.SanityManager;
-
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.dictionary.AliasDescriptor;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
-
-import org.apache.derby.catalog.AliasInfo;
+import org.apache.derby.iapi.sql.execute.ConstantAction;
 
 /**
  * A DropAliasNode  represents a DROP ALIAS statement.
  *
  */
 
-public class DropAliasNode extends DDLStatementNode
+class DropAliasNode extends DDLStatementNode
 {
 	private char aliasType;
 	private char nameSpace;
 
 	/**
-	 * Initializer for a DropAliasNode
+     * Constructor for a DropAliasNode
 	 *
 	 * @param dropAliasName	The name of the method alias being dropped
 	 * @param aliasType				Alias type
+     * @param cm  Context manager
 	 *
 	 * @exception StandardException
 	 */
-	public void init(Object dropAliasName, Object aliasType)
+    DropAliasNode(TableName dropAliasName, char aliasType, ContextManager cm)
 				throws StandardException
 	{
-		TableName dropItem = (TableName) dropAliasName;
-		initAndCheck(dropItem);
-		this.aliasType = ((Character) aliasType).charValue();
+        super(dropAliasName, cm);
+        setNodeType(C_NodeTypes.DROP_ALIAS_NODE);
+        this.aliasType = aliasType;
 	
 		switch (this.aliasType)
 		{
@@ -97,7 +90,7 @@ public class DropAliasNode extends DDLSt
 
 	public	char	getAliasType() { return aliasType; }
 
-	public String statementToString()
+    String statementToString()
 	{
 		return "DROP ".concat(aliasTypeName(aliasType));
 	}
@@ -108,6 +101,7 @@ public class DropAliasNode extends DDLSt
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
 	public void bindStatement() throws StandardException
 	{
 		DataDictionary	dataDictionary = getDataDictionary();
@@ -143,7 +137,8 @@ public class DropAliasNode extends DDLSt
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public ConstantAction	makeConstantAction() throws StandardException
+    @Override
+    public ConstantAction makeConstantAction() throws StandardException
 	{
 		return	getGenericConstantActionFactory().getDropAliasConstantAction(getSchemaDescriptor(), getRelativeName(), nameSpace);
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropIndexNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropIndexNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropIndexNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropIndexNode.java Fri Jun 21 07:47:47 2013
@@ -23,6 +23,8 @@ package	org.apache.derby.impl.sql.compil
 
 import org.apache.derby.iapi.error.StandardException;
 import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.ConstraintDescriptor;
@@ -37,12 +39,17 @@ import org.apache.derby.iapi.sql.execute
  *
  */
 
-public class DropIndexNode extends DDLStatementNode
+class DropIndexNode extends DDLStatementNode
 {
 	private ConglomerateDescriptor	cd;
 	private TableDescriptor			td;
 
-	public String statementToString()
+    DropIndexNode(TableName index, ContextManager cm) {
+        super(index, cm);
+        setNodeType(C_NodeTypes.DROP_INDEX_NODE);
+    }
+
+    String statementToString()
 	{
 		return "DROP INDEX";
 	}
@@ -54,6 +61,7 @@ public class DropIndexNode extends DDLSt
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
 	public void bindStatement() throws StandardException
 	{
 		CompilerContext			cc = getCompilerContext();
@@ -105,7 +113,8 @@ public class DropIndexNode extends DDLSt
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public ConstantAction	makeConstantAction() throws StandardException
+    @Override
+    public ConstantAction makeConstantAction() throws StandardException
 	{
 		return	getGenericConstantActionFactory().getDropIndexConstantAction( getFullName(),
 											 getRelativeName(),

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropRoleNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropRoleNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropRoleNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropRoleNode.java Fri Jun 21 07:47:47 2013
@@ -21,37 +21,39 @@
 
 package org.apache.derby.impl.sql.compile;
 
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.sanity.SanityManager;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.conn.Authorizer;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-
 /**
  * A DropRoleNode is the root of a QueryTree that represents
  * a DROP ROLE statement.
  *
  */
 
-public class DropRoleNode extends DDLStatementNode
+class DropRoleNode extends DDLStatementNode
 {
     private String roleName;
 
     /**
-     * Initializer for a DropRoleNode
+     * Constructor for a DropRoleNode
      *
      * @param roleName      The name of the object being dropped
+     * @param cm            Context manager
      *
      */
-    public void init(Object roleName)
-        throws StandardException
+    DropRoleNode(String roleName, ContextManager cm) throws StandardException
     {
-        initAndCheck(null);
-        this.roleName = (String)roleName;
+        super(null, cm);
+        this.roleName = roleName;
+        setNodeType(C_NodeTypes.DROP_ROLE_NODE);
     }
 
+    @Override
     public void bindStatement() throws StandardException
     {
         CompilerContext cc = getCompilerContext();
@@ -66,7 +68,7 @@ public class DropRoleNode extends DDLSta
      *
      * @return  This object as a String
      */
-
+    @Override
     public String toString()
     {
         if (SanityManager.DEBUG) {
@@ -77,6 +79,7 @@ public class DropRoleNode extends DDLSta
         }
     }
 
+    @Override
     public String statementToString()
     {
         return "DROP ROLE";
@@ -89,6 +92,7 @@ public class DropRoleNode extends DDLSta
      *
      * @exception StandardException         Thrown on failure
      */
+    @Override
     public ConstantAction   makeConstantAction() throws StandardException
     {
         return  getGenericConstantActionFactory().

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropSchemaNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropSchemaNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropSchemaNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropSchemaNode.java Fri Jun 21 07:47:47 2013
@@ -21,43 +21,44 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.sql.compile.CompilerContext;
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.conn.Authorizer;
 import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;
 import org.apache.derby.iapi.sql.conn.StatementContext;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 
-import org.apache.derby.iapi.error.StandardException;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
-import org.apache.derby.iapi.reference.SQLState;
-
 /**
  * A DropSchemaNode is the root of a QueryTree that represents 
  * a DROP SCHEMA statement.
  *
  */
 
-public class DropSchemaNode extends DDLStatementNode
+class DropSchemaNode extends DDLStatementNode
 {
 	private int			dropBehavior;
 	private String		schemaName;
 
 	/**
-	 * Initializer for a DropSchemaNode
+     * Constructor for a DropSchemaNode
 	 *
 	 * @param schemaName		The name of the object being dropped
 	 * @param dropBehavior		Drop behavior (RESTRICT | CASCADE)
+     * @param cm                Context Manager
 	 *
 	 */
-	public void init(Object schemaName, Object dropBehavior)
-		throws StandardException
+    DropSchemaNode(String schemaName, int dropBehavior, ContextManager cm)
 	{
-		initAndCheck(null);
-		this.schemaName = (String) schemaName;
-		this.dropBehavior = ((Integer) dropBehavior).intValue();
+        super(null, cm);
+        setNodeType(C_NodeTypes.DROP_SCHEMA_NODE);
+        this.schemaName = schemaName;
+        this.dropBehavior = dropBehavior;
 	}
 
+    @Override
 	public void bindStatement() throws StandardException
 	{
 		/* 
@@ -93,7 +94,7 @@ public class DropSchemaNode extends DDLS
 	 *
 	 * @return	This object as a String
 	 */
-
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG)
@@ -107,7 +108,7 @@ public class DropSchemaNode extends DDLS
 		}
 	}
 
-	public String statementToString()
+    String statementToString()
 	{
 		return "DROP SCHEMA";
 	}
@@ -120,7 +121,8 @@ public class DropSchemaNode extends DDLS
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public ConstantAction	makeConstantAction() throws StandardException
+    @Override
+    public ConstantAction makeConstantAction() throws StandardException
 	{
 		return	getGenericConstantActionFactory().getDropSchemaConstantAction(schemaName);
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropSequenceNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropSequenceNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropSequenceNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropSequenceNode.java Fri Jun 21 07:47:47 2013
@@ -24,6 +24,8 @@ package org.apache.derby.impl.sql.compil
 import org.apache.derby.iapi.sql.execute.ConstantAction;
 import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.dictionary.SequenceDescriptor;
@@ -32,19 +34,20 @@ import org.apache.derby.iapi.sql.diction
  * A DropSequenceNode  represents a DROP SEQUENCE statement.
  */
 
-public class DropSequenceNode extends DDLStatementNode {
+class DropSequenceNode extends DDLStatementNode {
     private TableName dropItem;
 
     /**
-     * Initializer for a DropSequenceNode
+     * Constructor for a DropSequenceNode
      *
      * @param dropSequenceName The name of the sequence being dropped
+     * @param cm               The context manager
      * @throws StandardException
      */
-    public void init(Object dropSequenceName)
-            throws StandardException {
-        dropItem = (TableName) dropSequenceName;
-        initAndCheck(dropItem);
+    DropSequenceNode(TableName dropSequenceName, ContextManager cm) {
+        super(dropSequenceName, cm);
+        setNodeType(C_NodeTypes.DROP_SEQUENCE_NODE);
+        dropItem = dropSequenceName;
     }
 
     public String statementToString() {
@@ -56,6 +59,7 @@ public class DropSequenceNode extends DD
      *
      * @throws StandardException Thrown on error
      */
+    @Override
     public void bindStatement() throws StandardException {
         DataDictionary dataDictionary = getDataDictionary();
         String sequenceName = getRelativeName();
@@ -83,6 +87,7 @@ public class DropSequenceNode extends DD
      *
      * @throws StandardException Thrown on failure
      */
+    @Override
     public ConstantAction makeConstantAction() throws StandardException {
         return getGenericConstantActionFactory().getDropSequenceConstantAction(getSchemaDescriptor(), getRelativeName());
 	}

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropTableNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropTableNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropTableNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropTableNode.java Fri Jun 21 07:47:47 2013
@@ -22,7 +22,9 @@
 package	org.apache.derby.impl.sql.compile;
 
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.context.ContextManager;
 import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.dictionary.ConglomerateDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
@@ -34,25 +36,26 @@ import org.apache.derby.iapi.sql.execute
  *
  */
 
-public class DropTableNode extends DDLStatementNode
+class DropTableNode extends DDLStatementNode
 {
 	private long		conglomerateNumber;
 	private int			dropBehavior;
 	private	TableDescriptor	td;
 
 	/**
-	 * Intializer for a DropTableNode
+     * Constructor for a DropTableNode
 	 *
 	 * @param dropObjectName	The name of the object being dropped
 	 * @param dropBehavior		Drop behavior (RESTRICT | CASCADE)
+     * @param cm                The context manager
 	 *
 	 */
-
-	public void init(Object dropObjectName, Object dropBehavior)
+    DropTableNode(TableName dropObjectName, int dropBehavior, ContextManager cm)
 		throws StandardException
 	{
-		initAndCheck(dropObjectName);
-		this.dropBehavior = ((Integer) dropBehavior).intValue();
+        super(dropObjectName, cm);
+        this.dropBehavior = dropBehavior;
+        setNodeType(C_NodeTypes.DROP_TABLE_NODE);
 	}
 
 	/**
@@ -61,7 +64,7 @@ public class DropTableNode extends DDLSt
 	 *
 	 * @return	This object as a String
 	 */
-
+    @Override
 	public String toString()
 	{
 		if (SanityManager.DEBUG)
@@ -77,7 +80,7 @@ public class DropTableNode extends DDLSt
 		}
 	}
 
-	public String statementToString()
+    String statementToString()
 	{
 		return "DROP TABLE";
 	}
@@ -89,7 +92,7 @@ public class DropTableNode extends DDLSt
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
-
+    @Override
 	public void bindStatement() throws StandardException
 	{
 		CompilerContext			cc = getCompilerContext();
@@ -113,6 +116,7 @@ public class DropTableNode extends DDLSt
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
 	public boolean referencesSessionSchema()
 		throws StandardException
 	{
@@ -128,7 +132,8 @@ public class DropTableNode extends DDLSt
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public ConstantAction	makeConstantAction() throws StandardException
+    @Override
+    public ConstantAction makeConstantAction() throws StandardException
 	{
 		return	getGenericConstantActionFactory().getDropTableConstantAction(
 			getFullName(),

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropTriggerNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropTriggerNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropTriggerNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropTriggerNode.java Fri Jun 21 07:47:47 2013
@@ -21,27 +21,32 @@
 
 package	org.apache.derby.impl.sql.compile;
 
+import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.reference.SQLState;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
 import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TriggerDescriptor;
-import org.apache.derby.iapi.reference.SQLState;
 import org.apache.derby.iapi.sql.execute.ConstantAction;
-import org.apache.derby.iapi.error.StandardException;
-import org.apache.derby.iapi.services.context.ContextManager;
-import org.apache.derby.iapi.services.sanity.SanityManager;
 
 /**
  * A DropTriggerNode is the root of a QueryTree that represents a DROP TRIGGER
  * statement.
  *
  */
-public class DropTriggerNode extends DDLStatementNode
+class DropTriggerNode extends DDLStatementNode
 {
 	private TableDescriptor td;
 
-	public String statementToString()
+    DropTriggerNode(TableName trigger, ContextManager cm) {
+        super(trigger, cm);
+        setNodeType(C_NodeTypes.DROP_TRIGGER_NODE);
+    }
+
+    String statementToString()
 	{
 		return "DROP TRIGGER";
 	}
@@ -53,6 +58,7 @@ public class DropTriggerNode extends DDL
 	 *
 	 * @exception StandardException		Thrown on error
 	 */
+    @Override
 	public void bindStatement() throws StandardException
 	{
 		CompilerContext			cc = getCompilerContext();
@@ -83,7 +89,8 @@ public class DropTriggerNode extends DDL
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public ConstantAction	makeConstantAction() throws StandardException
+    @Override
+    public ConstantAction makeConstantAction() throws StandardException
 	{
 		return	getGenericConstantActionFactory().getDropTriggerConstantAction(
 										 	getSchemaDescriptor(),

Modified: db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropViewNode.java
URL: http://svn.apache.org/viewvc/db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropViewNode.java?rev=1495305&r1=1495304&r2=1495305&view=diff
==============================================================================
--- db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropViewNode.java (original)
+++ db/derby/code/trunk/java/engine/org/apache/derby/impl/sql/compile/DropViewNode.java Fri Jun 21 07:47:47 2013
@@ -21,21 +21,13 @@
 
 package	org.apache.derby.impl.sql.compile;
 
-import org.apache.derby.iapi.services.context.ContextManager;
-
-import org.apache.derby.iapi.sql.execute.ConstantAction;
-
-import org.apache.derby.impl.sql.compile.ActivationClassBuilder;
-import org.apache.derby.impl.sql.execute.BaseActivation;
-import org.apache.derby.iapi.sql.ResultSet;
-
 import org.apache.derby.iapi.error.StandardException;
+import org.apache.derby.iapi.services.context.ContextManager;
+import org.apache.derby.iapi.sql.compile.C_NodeTypes;
 import org.apache.derby.iapi.sql.compile.CompilerContext;
 import org.apache.derby.iapi.sql.dictionary.DataDictionary;
-import org.apache.derby.iapi.sql.dictionary.SchemaDescriptor;
 import org.apache.derby.iapi.sql.dictionary.TableDescriptor;
-
-import org.apache.derby.iapi.services.sanity.SanityManager;
+import org.apache.derby.iapi.sql.execute.ConstantAction;
 
 /**
  * A DropViewNode is the root of a QueryTree that represents a DROP VIEW
@@ -43,23 +35,23 @@ import org.apache.derby.iapi.services.sa
  *
  */
 
-public class DropViewNode extends DDLStatementNode
+class DropViewNode extends DDLStatementNode
 {
 
 	/**
-	 * Initializer for a DropViewNode
+     * Constructor for a DropViewNode
 	 *
-	 * @param dropObjectName	The name of the object being dropped
+     * @param view              The name of the view being dropped
+     * @param cm                The context manager
 	 *
 	 */
-
-	public void init(Object dropObjectName)
-		throws StandardException
+    DropViewNode(TableName view, ContextManager cm)
 	{
-		initAndCheck(dropObjectName);
+        super(view, cm);
+        setNodeType(C_NodeTypes.DROP_VIEW_NODE);
 	}
 
-	public String statementToString()
+    String statementToString()
 	{
 		return "DROP VIEW";
 	}
@@ -70,7 +62,7 @@ public class DropViewNode extends DDLSta
  	 *
  	 * @exception StandardException		Thrown on error
  	 */
-	
+    @Override
 	public void bindStatement() throws StandardException
 	{
 		DataDictionary dd = getDataDictionary();
@@ -100,7 +92,8 @@ public class DropViewNode extends DDLSta
 	 *
 	 * @exception StandardException		Thrown on failure
 	 */
-	public ConstantAction	makeConstantAction() throws StandardException
+    @Override
+    public ConstantAction makeConstantAction() throws StandardException
 	{
 		return	getGenericConstantActionFactory().getDropViewConstantAction( getFullName(),
 											 getRelativeName(),



Mime
View raw message