Top Description Methods
org.apache.derby.iapi.sql.execute

public Interface RowChanger

Known Direct Implementers
org.apache.derby.impl.sql.execute.RowChangerImpl
Imports
org.apache.derby.iapi.services.context.ContextService, org.apache.derby.shared.common.sanity.SanityManager, org.apache.derby.iapi.services.io.FormatableBitSet, org.apache.derby.shared.common.error.StandardException, org.apache.derby.iapi.sql.conn.LanguageConnectionContext, org.apache.derby.iapi.sql.dictionary.IndexRowGenerator, org.apache.derby.iapi.store.access.ConglomerateController, .TransactionController, org.apache.derby.iapi.types.RowLocation

Perform row at a time DML operations of tables and maintain indexes.

Method Summary

Modifier and TypeMethod and Description
public void
close()

Close this RowChanger.

public void
deleteRow(ExecRow
the row.
baseRow
,
RowLocation
the row's base conglomerate location
baseRowLocation
)

Delete a row from the table and perform associated index maintenance.

public int

Returns:

column no, or -1 if not found or not a base column
findSelectedCol
(int
the column number in the base table of a selected column or -1 (if selected column is not a base table column, e.g. i+4).
selectedCol
)

Return what column no in the input ExecRow (cf nextBaseRow argument to #updateRow) would correspond to selected column, if any.

public void
finish()

Finish processing the changes.

public ConglomerateController

Returns:

The ConglomerateController from this RowChanger.
getHeapConglomerateController
()

Return the ConglomerateController from this RowChanger.

public RowLocation

Returns:

row location if requested, else null.
insertRow
(ExecRow
the row.
baseRow
,
boolean
return a row location of the inserted row
getRL
)

Insert a row into the table and perform associated index maintenance.

public void
open(int
The lock mode to use (row or table, see TransactionController)
lockMode
)

Open this RowChanger.

public void
open(int
The lock mode to use (row or table, see TransactionController)
lockMode
,
boolean
If true, then the caller wants to wait for locks. False will be when we using a nested user xaction - we want to timeout right away if the parent holds the lock.
wait
)

Open this RowChanger.

public void
openForUpdate(boolean[]
fixOnUpdat[ix] == true ==> fix index 'ix' on an update operation.
fixOnUpdate
,
int
The lock mode to use (row or table, see TransactionController)
lockMode
,
boolean
If true, then the caller wants to wait for locks. False will be when we using a nested user xaction - we want to timeout right away if the parent holds the lock. (bug 4821)
wait
)

Open this RowChanger to avoid fixing indexes that do not change during update operations.

public void
setIndexNames(String[]
Names of all the indices on this table.
indexNames
)

Sets the index names of the tables indices.

public void
setRowHolder(TemporaryRowHolder
the row holder
rowHolder
)

Set the row holder for this changer to use.

public void
updateRow(ExecRow
the old image of the row.
oldBaseRow
,
ExecRow
the new image of the row.
newBaseRow
,
RowLocation
the row's base conglomerate location
baseRowLocation
)

Update a row in the table and perform associated index maintenance.

Method Detail

closeback to summary
public void close() throws StandardException

Close this RowChanger.

Exceptions
StandardException:
Thrown on error
deleteRowback to summary
public void deleteRow(ExecRow baseRow, RowLocation baseRowLocation) throws StandardException

Delete a row from the table and perform associated index maintenance.

Parameters
baseRow:ExecRow

the row.

baseRowLocation:RowLocation

the row's base conglomerate location

Exceptions
StandardException:
Thrown on error
findSelectedColback to summary
public int findSelectedCol(int selectedCol)

Return what column no in the input ExecRow (cf nextBaseRow argument to #updateRow) would correspond to selected column, if any.

Parameters
selectedCol:int

the column number in the base table of a selected column or -1 (if selected column is not a base table column, e.g. i+4).

Returns:int

column no, or -1 if not found or not a base column

finishback to summary
public void finish() throws StandardException

Finish processing the changes. This means applying the deferred inserts for updates to unique indexes.

Exceptions
StandardException:
Thrown on error
getHeapConglomerateControllerback to summary
public ConglomerateController getHeapConglomerateController()

Return the ConglomerateController from this RowChanger. This is useful when copying properties from heap to temp conglomerate on insert/update/delete.

Returns:ConglomerateController

The ConglomerateController from this RowChanger.

insertRowback to summary
public RowLocation insertRow(ExecRow baseRow, boolean getRL) throws StandardException

Insert a row into the table and perform associated index maintenance.

Parameters
baseRow:ExecRow

the row.

getRL:boolean

return a row location of the inserted row

Returns:RowLocation

row location if requested, else null.

Exceptions
StandardException:
Thrown on error
openback to summary
public void open(int lockMode) throws StandardException

Open this RowChanger.

Note to avoid the cost of fixing indexes that do not change during update operations use openForUpdate().

Parameters
lockMode:int

The lock mode to use (row or table, see TransactionController)

Exceptions
StandardException:
thrown on failure to convert
openback to summary
public void open(int lockMode, boolean wait) throws StandardException

Open this RowChanger.

Note to avoid the cost of fixing indexes that do not change during update operations use openForUpdate().

Parameters
lockMode:int

The lock mode to use (row or table, see TransactionController)

wait:boolean

If true, then the caller wants to wait for locks. False will be when we using a nested user xaction - we want to timeout right away if the parent holds the lock.

Exceptions
StandardException:
thrown on failure to convert
openForUpdateback to summary
public void openForUpdate(boolean[] fixOnUpdate, int lockMode, boolean wait) throws StandardException

Open this RowChanger to avoid fixing indexes that do not change during update operations.

Parameters
fixOnUpdate:boolean[]

fixOnUpdat[ix] == true ==> fix index 'ix' on an update operation.

lockMode:int

The lock mode to use (row or table, see TransactionController)

wait:boolean

If true, then the caller wants to wait for locks. False will be when we using a nested user xaction - we want to timeout right away if the parent holds the lock. (bug 4821)

Exceptions
StandardException:
thrown on failure to convert
setIndexNamesback to summary
public void setIndexNames(String[] indexNames)

Sets the index names of the tables indices. Used for error reporting.

Parameters
indexNames:String[]

Names of all the indices on this table.

setRowHolderback to summary
public void setRowHolder(TemporaryRowHolder rowHolder)

Set the row holder for this changer to use. If the row holder is set, it wont bother saving copies of rows needed for deferred processing. Also, it will never close the passed in rowHolder.

Parameters
rowHolder:TemporaryRowHolder

the row holder

updateRowback to summary
public void updateRow(ExecRow oldBaseRow, ExecRow newBaseRow, RowLocation baseRowLocation) throws StandardException

Update a row in the table and perform associated index maintenance.

Parameters
oldBaseRow:ExecRow

the old image of the row.

newBaseRow:ExecRow

the new image of the row.

baseRowLocation:RowLocation

the row's base conglomerate location

Exceptions
StandardException:
Thrown on error