Class ExecRowBuilder
java.lang.Object
org.apache.derby.iapi.sql.execute.ExecRowBuilder
- All Implemented Interfaces:
Externalizable
,Serializable
,Formatable
,TypedFormat
A class used for storing information on how to build ExecRow
instances. Typically created by the compiler and used during execution
to produce and reset row templates.
This class must be Formatable
so that it can be stored in the
database as part of a stored prepared statement generated for trigger
actions or metadata queries. The stored format does not need to be stable
across different versions, since the stored prepared statements are
discarded on upgrade and will never be read by other Derby versions than
the one that originally wrote them.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate int[]
Array of 1-based column numbers for the columns to access.private int
The number of columns to set in the row.private boolean
If true, the row should be anExecIndexRow
.private int
The highest column number in the row.private Object[]
Array of templates used for creating NULL values to put in the row. -
Constructor Summary
ConstructorsConstructorDescriptionPublic no-arg constructor required by theFormatable
interface.ExecRowBuilder
(int size, boolean indexable) Create an instance that produces anExecRow
instance of the specified size. -
Method Summary
Modifier and TypeMethodDescriptionBuild a newExecRow
instance with the columns specified by thesetColumn(int, Object)
method initialized to empty (NULL) values.int
Get a universally unique identifier for the type of this object.void
void
Reset a row by creating fresh NULL values.void
Add a template from which a NULL value of the correct type can be created.void
-
Field Details
-
indexable
private boolean indexableIf true, the row should be anExecIndexRow
. -
template
Array of templates used for creating NULL values to put in the row. The templates are eitherDataValueDescriptor
s orDataTypeDescriptor
s. -
columns
private int[] columnsArray of 1-based column numbers for the columns to access. -
count
private int countThe number of columns to set in the row. -
maxColumnNumber
private int maxColumnNumberThe highest column number in the row.
-
-
Constructor Details
-
ExecRowBuilder
public ExecRowBuilder(int size, boolean indexable) Create an instance that produces anExecRow
instance of the specified size.- Parameters:
size
- the number of columns to initialize in the produced rowindexable
-true
if the returned row should be anExecIndexRow
,false
otherwise
-
ExecRowBuilder
public ExecRowBuilder()Public no-arg constructor required by theFormatable
interface. Should not be called directly.
-
-
Method Details
-
setColumn
Add a template from which a NULL value of the correct type can be created. It should either be aDataValueDescriptor
or aDataTypeDescriptor
.- Parameters:
column
- the column numbercolumnTemplate
- a template from which a NULL value can be created (either aDataValueDescriptor
or aDataTypeDescriptor
)
-
build
Build a newExecRow
instance with the columns specified by thesetColumn(int, Object)
method initialized to empty (NULL) values.- Parameters:
ef
- an execution factory used to create a row- Returns:
- a row initialized with NULL values of the requested types
- Throws:
StandardException
-
reset
Reset a row by creating fresh NULL values.- Parameters:
row
- the row to reset- Throws:
StandardException
-
writeExternal
- Specified by:
writeExternal
in interfaceExternalizable
- Throws:
IOException
-
readExternal
- Specified by:
readExternal
in interfaceExternalizable
- Throws:
IOException
ClassNotFoundException
-
getTypeFormatId
public int getTypeFormatId()Description copied from interface:TypedFormat
Get a universally unique identifier for the type of this object.- Specified by:
getTypeFormatId
in interfaceTypedFormat
- Returns:
- The identifier. (A UUID stuffed in an array of 16 bytes).
-