--- /dev/null
+/*\r
+\r
+ Derby - Class org.apache.derby.iapi.sql.execute.RowChanger\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.services.context.ContextService;\r
+import org.apache.derby.iapi.services.sanity.SanityManager;\r
+\r
+import org.apache.derby.iapi.error.StandardException;\r
+\r
+import org.apache.derby.iapi.sql.conn.LanguageConnectionContext;\r
+import org.apache.derby.iapi.sql.dictionary.IndexRowGenerator;\r
+\r
+import org.apache.derby.iapi.store.access.ConglomerateController;\r
+import org.apache.derby.iapi.types.RowLocation;\r
+import org.apache.derby.iapi.store.access.TransactionController;\r
+\r
+/**\r
+ Perform row at a time DML operations of tables and maintain indexes.\r
+ */\r
+public interface RowChanger\r
+{\r
+ /**\r
+ Open this RowChanger.\r
+\r
+ <P>Note to avoid the cost of fixing indexes that do not\r
+ change during update operations use openForUpdate(). \r
+ @param lockMode The lock mode to use\r
+ (row or table, see TransactionController)\r
+\r
+ @exception StandardException thrown on failure to convert\r
+ */\r
+ public void open(int lockMode)\r
+ throws StandardException;\r
+\r
+ /**\r
+ * Set the row holder for this changer to use.\r
+ * If the row holder is set, it wont bother \r
+ * saving copies of rows needed for deferred\r
+ * processing. Also, it will never close the\r
+ * passed in rowHolder.\r
+ *\r
+ * @param rowHolder the row holder\r
+ */\r
+ public void setRowHolder(TemporaryRowHolder rowHolder);\r
+\r
+ /**\r
+ * Sets the index names of the tables indices. Used for error reporting.\r
+ * \r
+ * @param indexNames Names of all the indices on this table.\r
+ */\r
+ public void setIndexNames(String[] indexNames);\r
+\r
+ /**\r
+ Open this RowChanger to avoid fixing indexes that do not change\r
+ during update operations. \r
+\r
+ @param fixOnUpdate fixOnUpdat[ix] == true ==> fix index 'ix' on\r
+ an update operation.\r
+ @param lockMode The lock mode to use\r
+ (row or table, see TransactionController)\r
+ @param wait If true, then the caller wants to wait for locks. False will be\r
+ when we using a nested user xaction - we want to timeout right away\r
+ if the parent holds the lock. (bug 4821)\r
+\r
+ @exception StandardException thrown on failure to convert\r
+ */\r
+ public void openForUpdate( boolean[] fixOnUpdate, int lockMode, boolean wait )\r
+ throws StandardException;\r
+\r
+ /**\r
+ Insert a row into the table and perform associated index maintenance.\r
+\r
+ @param baseRow the row.\r
+ @exception StandardException Thrown on error\r
+ */\r
+ public void insertRow(ExecRow baseRow)\r
+ throws StandardException;\r
+ \r
+ /**\r
+ Delete a row from the table and perform associated index maintenance.\r
+\r
+ @param baseRow the row.\r
+ @param baseRowLocation the row's base conglomerate\r
+ location\r
+ @exception StandardException Thrown on error\r
+ */\r
+ public void deleteRow(ExecRow baseRow, RowLocation baseRowLocation)\r
+ throws StandardException;\r
+\r
+ /**\r
+ Update a row in the table and perform associated index maintenance.\r
+\r
+ @param oldBaseRow the old image of the row.\r
+ @param newBaseRow the new image of the row.\r
+ @param baseRowLocation the row's base conglomerate\r
+ location\r
+ @exception StandardException Thrown on error\r
+ */\r
+ public void updateRow(ExecRow oldBaseRow,\r
+ ExecRow newBaseRow,\r
+ RowLocation baseRowLocation)\r
+ throws StandardException;\r
+\r
+ /**\r
+ Finish processing the changes. This means applying the deferred\r
+ inserts for updates to unique indexes.\r
+\r
+ @exception StandardException Thrown on error\r
+ */\r
+ public void finish()\r
+ throws StandardException;\r
+\r
+ /**\r
+ Close this RowChanger.\r
+\r
+ @exception StandardException Thrown on error\r
+ */\r
+ public void close()\r
+ throws StandardException;\r
+\r
+ /** \r
+ * Return the ConglomerateController from this RowChanger.\r
+ * This is useful when copying properties from heap to \r
+ * temp conglomerate on insert/update/delete.\r
+ *\r
+ * @return The ConglomerateController from this RowChanger.\r
+ */\r
+ public ConglomerateController getHeapConglomerateController();\r
+\r
+ /**\r
+ Open this RowChanger.\r
+\r
+ <P>Note to avoid the cost of fixing indexes that do not\r
+ change during update operations use openForUpdate(). \r
+ @param lockMode The lock mode to use\r
+ (row or table, see TransactionController)\r
+ @param wait If true, then the caller wants to wait for locks. False will be\r
+ when we using a nested user xaction - we want to timeout right away\r
+ if the parent holds the lock. \r
+\r
+ @exception StandardException thrown on failure to convert\r
+ */\r
+ public void open(int lockMode, boolean wait)\r
+ throws StandardException;\r
+}\r