--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.iapi.sql.execute.ExecutionFactory\r
+\r
+ Licensed to the Apache Software Foundation (ASF) under one or more\r
+ contributor license agreements. See the NOTICE file distributed with\r
+ this work for additional information regarding copyright ownership.\r
+ The ASF licenses this file to you under the Apache License, Version 2.0\r
+ (the "License"); you may not use this file except in compliance with\r
+ the License. You may obtain a copy of the License at\r
+\r
+ http://www.apache.org/licenses/LICENSE-2.0\r
+\r
+ Unless required by applicable law or agreed to in writing, software\r
+ distributed under the License is distributed on an "AS IS" BASIS,\r
+ WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.\r
+ See the License for the specific language governing permissions and\r
+ limitations under the License.\r
+\r
+ */\r
+\r
+package org.apache.derby.iapi.sql.execute;\r
+\r
+import org.apache.derby.iapi.sql.Activation;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;\r
+import org.apache.derby.iapi.sql.Activation;\r
+import org.apache.derby.iapi.sql.ResultColumnDescriptor;\r
+import org.apache.derby.iapi.sql.ResultDescription;\r
+\r
+import org.apache.derby.iapi.store.access.DynamicCompiledOpenConglomInfo;\r
+import org.apache.derby.iapi.store.access.Qualifier;\r
+import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;\r
+import org.apache.derby.iapi.store.access.StaticCompiledOpenConglomInfo;\r
+import org.apache.derby.iapi.store.access.TransactionController;\r
+import java.util.Properties;\r
+import org.apache.derby.iapi.services.io.FormatableBitSet;\r
+\r
+import org.apache.derby.iapi.services.loader.GeneratedMethod;\r
+import org.apache.derby.iapi.services.context.ContextManager;\r
+\r
+import org.apache.derby.catalog.TypeDescriptor;\r
+import org.apache.derby.catalog.UUID;\r
+\r
+/**\r
+ This is the factory for creating a factories needed by\r
+ execution per connection, and the context to hold them.\r
+ <p>\r
+ There is expected to be one of these configured per database.\r
+ <p>\r
+ If a factory is needed outside of execution (say,\r
+ data dictionary or compilation), then it belongs in the\r
+ LanguageConnectionContext.\r
+\r
+ @see org.apache.derby.iapi.sql.conn.LanguageConnectionContext\r
+ */\r
+public interface ExecutionFactory {\r
+\r
+ /**\r
+ Module name for the monitor's module locating system.\r
+ */\r
+ String MODULE = "org.apache.derby.iapi.sql.execute.ExecutionFactory";\r
+\r
+ /**\r
+ Only one result set factory is needed for a database\r
+ in the system.\r
+ We require that an execution factory be configured for\r
+ each database. Each execution factory then needs to\r
+ know about the result set factory it is maintaining\r
+ for its database, so that it can provide it through\r
+ calls to this method.\r
+ So, we reuse the result set factory by making it \r
+ available to each connection\r
+ in that connection's execution context.\r
+\r
+ @return the result set factory for this database.\r
+ */\r
+ ResultSetFactory getResultSetFactory();\r
+\r
+ /**\r
+ We want an execution context so that we can push it onto\r
+ the stack. We could instead require the implementation\r
+ push it onto the stack for us, but this way we know\r
+ which context object exactly was pushed onto the stack.\r
+\r
+ @param cm the context manager\r
+ */\r
+ ExecutionContext newExecutionContext(ContextManager cm);\r
+\r
+ /**\r
+ * Create an execution time ResultColumnDescriptor from a \r
+ * compile time RCD.\r
+ *\r
+ * @param compileRCD The compile time RCD.\r
+ *\r
+ * @return The execution time ResultColumnDescriptor\r
+ */\r
+ ResultColumnDescriptor getResultColumnDescriptor(ResultColumnDescriptor compileRCD);\r
+\r
+ /**\r
+ * Create a result description given parameters for it.\r
+ */\r
+ ResultDescription getResultDescription(ResultColumnDescriptor[] columns,\r
+ String statementType);\r
+\r
+ /**\r
+ * Get an array of ScanQualifiers for a scan. ScanQualifiers are used\r
+ * with the DataDictionary.\r
+ *\r
+ * @param numQualifiers The number of ScanQualifiers to get.\r
+ */\r
+ ScanQualifier[][] getScanQualifier(int numQualifiers);\r
+\r
+ /**\r
+ * Release a ScanQualifier[] (back to the pool or free it).\r
+ */\r
+\r
+ void releaseScanQualifier(ScanQualifier[][] scanQualifiers);\r
+\r
+ /**\r
+ * Get a Qualifier to use with a scan of a conglomerate.\r
+ *\r
+ * @param columnId The store id of the column to qualify\r
+ * @param operator One of Orderable.ORDER_OP_EQUALS,\r
+ * Orderable.ORDER_OP_LESSTHAN,\r
+ * or Orderable.ORDER_OP_LESSOREQUALS\r
+ * @param orderableGetter A generated method that returns the\r
+ * Orderable to be compared with the column\r
+ * @param activation The Activation that acts as the receiver for the\r
+ * generated method\r
+ * @param orderedNulls True means that null == null for the sake of\r
+ * this Qualifier\r
+ * @param unknownRV The value to return if the comparison between\r
+ * the column and the Orderable value returns the\r
+ * unknown truth value\r
+ * @param negateCompareResult True means to negate the result of the comparison.\r
+ * So, for example, to do a > comparison, you would\r
+ * pass ORDER_OP_LESSOREQUALS and set negate to true.\r
+ * @param variantType The variantType for the qualifier's orderable.\r
+ * (Determines whether or not to cache the value.)\r
+ *\r
+ * @return A new Qualifier\r
+ */\r
+ Qualifier getQualifier(int columnId,\r
+ int operator,\r
+ GeneratedMethod orderableGetter,\r
+ Activation activation,\r
+ boolean orderedNulls,\r
+ boolean unknownRV,\r
+ boolean negateCompareResult,\r
+ int variantType);\r
+\r
+ /**\r
+ Create a new RowChanger for performing update and delete\r
+ operations based on full before and after rows.\r
+\r
+ @param heapConglom Conglomerate # for the heap\r
+ @param heapSCOCI The SCOCI for the heap.\r
+ @param heapDCOCI The DCOCI for the heap.\r
+ @param irgs the IndexRowGenerators for the table's indexes. We use\r
+ positions in this array as local id's for indexes. To support updates,\r
+ only indexes that change need be included.\r
+ @param indexCIDS the conglomerateids for the table's idexes. \r
+ indexCIDS[ix] corresponds to the same index as irgs[ix].\r
+ @param indexSCOCIs the SCOCIs for the table's idexes. \r
+ indexSCOCIs[ix] corresponds to the same index as irgs[ix].\r
+ @param indexDCOCIs the DCOCIs for the table's idexes. \r
+ indexDCOCIs[ix] corresponds to the same index as irgs[ix].\r
+ @param numberOfColumns Number of columns in a full row.\r
+ @param tc the transaction controller\r
+ @param streamStorableHeapColIds Column ids of stream storable\r
+ columns. (0 based, Only needed for sync. null if none or\r
+ not needed).\r
+ @param activation The Activation.\r
+ @exception StandardException Thrown on error\r
+ */\r
+ public RowChanger\r
+ getRowChanger(long heapConglom,\r
+ StaticCompiledOpenConglomInfo heapSCOCI,\r
+ DynamicCompiledOpenConglomInfo heapDCOCI,\r
+ IndexRowGenerator[] irgs,\r
+ long[] indexCIDS,\r
+ StaticCompiledOpenConglomInfo[] indexSCOCIs,\r
+ DynamicCompiledOpenConglomInfo[] indexDCOCIs,\r
+ int numberOfColumns,\r
+ TransactionController tc,\r
+ int[] changedColumnIds,\r
+ int[] streamStorableHeapColIds,\r
+ Activation activation) throws StandardException;\r
+\r
+ /**\r
+ Create a new RowChanger for doing insert update and delete\r
+ operations based on partial before and after. \r
+\r
+ @param heapConglom Conglomerate # for the heap\r
+ @param heapSCOCI The SCOCI for the heap.\r
+ @param heapDCOCI The DCOCI for the heap.\r
+ @param irgs the IndexRowGenerators for the table's indexes. We use\r
+ positions in this array as local id's for indexes. To support updates,\r
+ only indexes that change need be included.\r
+ @param indexCIDS the conglomerateids for the table's idexes. \r
+ indexCIDS[ix] corresponds to the same index as irgs[ix].\r
+ @param indexSCOCIs the SCOCIs for the table's idexes. \r
+ indexSCOCIs[ix] corresponds to the same index as irgs[ix].\r
+ @param indexDCOCIs the DCOCIs for the table's idexes. \r
+ indexDCOCIs[ix] corresponds to the same index as irgs[ix].\r
+ @param numberOfColumns Number of columns in partial row.\r
+ @param tc the transaction controller \r
+ @param changedColumnIds array of 1 based ints of columns\r
+ to be updated. Used by update only.\r
+ @param baseRowReadList the columns in the base row that were\r
+ read (1 based)\r
+ @param baseRowReadMap baseRowReadMap[heapColId]->readRowColId\r
+ (0 based)\r
+ @param streamStorableColIds Column ids of stream storable\r
+ columns. (0 based, Only needed for sync. null if none or\r
+ not needed).\r
+ @param activation The Activation.\r
+\r
+ @exception StandardException Thrown on error\r
+ */\r
+ public RowChanger\r
+ getRowChanger(long heapConglom,\r
+ StaticCompiledOpenConglomInfo heapSCOCI,\r
+ DynamicCompiledOpenConglomInfo heapDCOCI,\r
+ IndexRowGenerator[] irgs,\r
+ long[] indexCIDS,\r
+ StaticCompiledOpenConglomInfo[] indexSCOCIs,\r
+ DynamicCompiledOpenConglomInfo[] indexDCOCIs,\r
+ int numberOfColumns,\r
+ TransactionController tc,\r
+ int[] changedColumnIds,\r
+ FormatableBitSet baseRowReadList,\r
+ int[] baseRowReadMap,\r
+ int[] streamStorableColIds,\r
+ Activation activation) throws StandardException;\r
+\r
+\r
+ // Methods from old RowFactory interface\r
+ /**\r
+ This returns a new row that is storable but not indexable \r
+ */\r
+ public ExecRow getValueRow(int numColumns);\r
+\r
+ /**\r
+ This returns an indexable row\r
+ */\r
+ public ExecIndexRow getIndexableRow(int numColumns);\r
+\r
+ /**\r
+ This returns the value row as an indexable row \r
+ */\r
+ public ExecIndexRow getIndexableRow(ExecRow valueRow);\r
+}\r