Package oracle.streams
Class DefaultChunkColumnValue
- java.lang.Object
-
- oracle.streams.DefaultColumnValue
-
- oracle.streams.DefaultChunkColumnValue
-
- All Implemented Interfaces:
ChunkColumnValue,ColumnValue
public class DefaultChunkColumnValue extends DefaultColumnValue implements ChunkColumnValue
The DefaultChunkColumnValue class provides an Oracle default implementation of the ChunkColumnValue interface.- See Also:
RowLCR
-
-
Field Summary
-
Fields inherited from interface oracle.streams.ChunkColumnValue
BLOB, CLOB, LONG, LONGRAW, NCLOB, OSON, XMLTYPE
-
Fields inherited from interface oracle.streams.ColumnValue
BFILE, BINARY_DOUBLE, BINARY_FLOAT, BOOLEAN, CHAR, DATE, INTERVALDS, INTERVALYM, NUMBER, RAW, RowID, TIMESTAMP, TIMESTAMPLTZ, TIMESTAMPTZ
-
-
Constructor Summary
Constructors Constructor Description DefaultChunkColumnValue(java.lang.String columnName, oracle.sql.Datum columnData, int chunkType)Constructs a DefaultChunkColumnValue object with the column information.DefaultChunkColumnValue(java.lang.String columnName, oracle.sql.Datum columnData, int chunkType, java.math.BigInteger chunkOffset, java.math.BigInteger chunkOperationSize)Constructs a DefaultChunkColumnValue object with the column information.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetCharSetId()Gets the chunk character set identifier (ID) for an XMLTYPE chunk
The character set ID indicates the character set used to interpret the XMLTYPE chunk data.java.math.BigIntegergetChunkOffset()Gets the chunk operation offset.java.math.BigIntegergetChunkOperationSize()Gets the chunk operation size.intgetChunkType()Gets the chunk type.oracle.sql.DatumgetUpdatedRowId()Gets the updated rowid after receiving all chunks for the row.booleanisEmptyChunk()Indicates whether the chunk is empty.booleanisEndOfRow()Indicates whether the chunk is the end of the entire row change.booleanisJSONDiff()Indicates whether the chunk is a JSONDiff.booleanisLastChunk()Indicates whether the chunk is the last one for the column.booleanisXMLDiff()Indicates whether the chunk is an XMLDiff.voidsetCharSetId(int charSetId)Sets the character set ID for an XMLTYPE chunk.voidsetChunkOffset(java.math.BigInteger chunkOffset)Sets the chunk operation offset.voidsetChunkOperationSize(java.math.BigInteger chunkOperationSize)Sets the chunk operation size.voidsetChunkType(int chunkType)Sets the chunk type.voidsetColumnData(oracle.sql.Datum columnData)Sets the column data for a ChunkColumnValue.voidsetColumnData(oracle.sql.Datum columnData, int columnDataType)Sets the column data.voidsetEmptyChunk(boolean emptyChunk)Sets the empty chunk flag.voidsetEndOfRow(boolean endOfRow)Sets the endOfRow chunk flag.voidsetJSONDiff(boolean jsonDiff)Sets the JsonDiff flag.voidsetLastChunk(boolean lastChunk)Sets the last chunk flag.voidsetUpdatedRowId(oracle.sql.Datum updatedRowId)Updates the rowid when chunk is the end of row.voidsetXMLDiff(boolean xmlDiff)Sets the XMLDiff flag.java.lang.StringtoString()-
Methods inherited from class oracle.streams.DefaultColumnValue
getCharsetId, getColumnData, getColumnDataType, getColumnName, getTDEFlag, is32kData, isBFile, isUrowid, set32kData, setBFile, setCharsetId, setColumnName, setTDEFlag, setUrowid
-
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface oracle.streams.ColumnValue
getCharsetId, getColumnData, getColumnDataType, getColumnName, getTDEFlag, is32kData, set32kData, setCharsetId, setColumnName, setTDEFlag
-
-
-
-
Constructor Detail
-
DefaultChunkColumnValue
public DefaultChunkColumnValue(java.lang.String columnName, oracle.sql.Datum columnData, int chunkType) throws StreamsExceptionConstructs a DefaultChunkColumnValue object with the column information.- Parameters:
columnName- The column name, cannot be NULLcolumnData- The column data, can be NULL. If NULL is used, a valid chunk type must be specified.chunkType- The chunk type as defined in ChunkColumnValue- Throws:
StreamsException- is thrown if columnName is NULL
-
DefaultChunkColumnValue
public DefaultChunkColumnValue(java.lang.String columnName, oracle.sql.Datum columnData, int chunkType, java.math.BigInteger chunkOffset, java.math.BigInteger chunkOperationSize) throws StreamsExceptionConstructs a DefaultChunkColumnValue object with the column information. as well as the offset and size.- Parameters:
columnName- The column name, cannot be NULLcolumnData- The column data, can be NULL. If NULL is used, a valid chunk type must be specified.chunkType- The chunk type as defined in ChunkColumnValuechunkOffset- The chunk operation offsetchunkOperationSize- The chunk operation size- Throws:
StreamsException- is thrown if chunkType is invalid
-
-
Method Detail
-
getChunkType
public int getChunkType()
Gets the chunk type.
Chunk type indicates the type of the column for which data can be divided into multiple chunks. Valid values are BLOB, CLOB, NCLOB, XMLTYPE or OSON (Oracle binary JSON format).- Specified by:
getChunkTypein interfaceChunkColumnValue- Returns:
- A integer contains the chunk type as defined in ChunkColumnValue
-
setChunkType
public void setChunkType(int chunkType) throws StreamsExceptionSets the chunk type.
Chunk type is used to specify the type of the column for which data can be divided into mutliple chunks. Valid values are BLOB, CLOB, NCLOB, XMLTYPE or OSON (Oracle binary JSON format). See chunk type definition in ChunkColumnValue.- Specified by:
setChunkTypein interfaceChunkColumnValue- Parameters:
chunkType- The chunk type as defined in ChunkColumnValue- Throws:
StreamsException- is thrown if chunk type is unsupported
-
getUpdatedRowId
public oracle.sql.Datum getUpdatedRowId()
Gets the updated rowid after receiving all chunks for the row.
The updated rowid is in oracle.sql.CHAR format. It is valid only when the chunk is the end of the entire row, otherwise it will be null.- Specified by:
getUpdatedRowIdin interfaceChunkColumnValue- Returns:
- an datum object that contains the updated rowid
-
setUpdatedRowId
public void setUpdatedRowId(oracle.sql.Datum updatedRowId)
Updates the rowid when chunk is the end of row.- Specified by:
setUpdatedRowIdin interfaceChunkColumnValue- Parameters:
updatedRowId- The updated rowid after all chunks
-
setColumnData
public void setColumnData(oracle.sql.Datum columnData)
Sets the column data for a ChunkColumnValue.
Column data in a chunk can be an instance of either oracle.sql.CHAR or oracle.sql.RAW.- Parameters:
columnData- The column data, instance of oracle.sql.Datum subclass.
-
setColumnData
public void setColumnData(oracle.sql.Datum columnData, int columnDataType) throws StreamsExceptionSets the column data.
This method overwrites the method defined in parent class ColumnValue.
columnDataType is ignored in this class since the columnDataType can be derived from chunkType if it is a ChunkColumnValue object. The mapping is maintained internally.- Specified by:
setColumnDatain interfaceColumnValue- Overrides:
setColumnDatain classDefaultColumnValue- Parameters:
columnData- The column data, instance of oracle.sql.Datum subclasses.columnDataType- The column data type as defined in ColumnValue.- Throws:
StreamsException- is thrown if the columnData is NULL and the columnDataType maintained internally is invalid.
-
getChunkOffset
public java.math.BigInteger getChunkOffset()
Gets the chunk operation offset.
This method is used to obtain the offset information for piecewise LOB operations. For DML operations, NULL is returned.
If there are multiple chunks for one LOB WRITE operation, only the offset of the first chunk is relevant.- Specified by:
getChunkOffsetin interfaceChunkColumnValue- Returns:
- a BigInteger contains the chunk operation offset
-
getCharSetId
public int getCharSetId()
Gets the chunk character set identifier (ID) for an XMLTYPE chunk
The character set ID indicates the character set used to interpret the XMLTYPE chunk data.
Check oracle.sql.CharacterSet for the definition of Oracle CharacterSet Id.- Specified by:
getCharSetIdin interfaceChunkColumnValue- Returns:
- An integer that indicates the character set
-
setChunkOffset
public void setChunkOffset(java.math.BigInteger chunkOffset)
Sets the chunk operation offset.
Setting the chunk operation offset is required for a piecwise LOB operation in which the offset indicates the starting point for the LOB operation. The offset value starts at 1.- Specified by:
setChunkOffsetin interfaceChunkColumnValue- Parameters:
chunkOffset- The chunk operation offset
-
getChunkOperationSize
public java.math.BigInteger getChunkOperationSize()
Gets the chunk operation size.
Use this method to obtain the size information for piecewise LOB operations. For DML operations, NULL is returned.- Specified by:
getChunkOperationSizein interfaceChunkColumnValue- Returns:
- A BigInteger contains the chunk operation size
-
setChunkOperationSize
public void setChunkOperationSize(java.math.BigInteger chunkOperationSize)
Sets the chunk operation size.
Setting the chunk operation size is required for piecewise LOB ERASE and LOB TRIM operations. For LOB ERASE operations, the chunk operation size specifies the amount of data to erase. For LOB TRIM operations, the chunk operation size specified the amount of data to trim.- Specified by:
setChunkOperationSizein interfaceChunkColumnValue- Parameters:
chunkOperationSize- The chunk operation size
-
isLastChunk
public boolean isLastChunk()
Indicates whether the chunk is the last one for the column.- Specified by:
isLastChunkin interfaceChunkColumnValue- Returns:
- a boolean flag indicates if this is the last chunk
-
isEmptyChunk
public boolean isEmptyChunk()
Indicates whether the chunk is empty. For a LOB column, an empty LOB is different from a column that contains a NULL.- Specified by:
isEmptyChunkin interfaceChunkColumnValue- Returns:
- a boolean flag indicates if this is an empty chunk
-
isXMLDiff
public boolean isXMLDiff()
Indicates whether the chunk is an XMLDiff.- Specified by:
isXMLDiffin interfaceChunkColumnValue- Returns:
- a boolean flag indicates if this is an XMLDiff
-
isJSONDiff
public boolean isJSONDiff()
Indicates whether the chunk is a JSONDiff.- Specified by:
isJSONDiffin interfaceChunkColumnValue- Returns:
- a boolean flag indicates if this is the end of row change.
-
isEndOfRow
public boolean isEndOfRow()
Indicates whether the chunk is the end of the entire row change.
A chunk is the end of the entire row change if it is the last chunk for the last column in an LCR.- Specified by:
isEndOfRowin interfaceChunkColumnValue- Returns:
- True if this is the end of row change.
-
setLastChunk
public void setLastChunk(boolean lastChunk)
Sets the last chunk flag.
The last chunk flag indicates whether the chunk is the last one for the current column.- Specified by:
setLastChunkin interfaceChunkColumnValue- Parameters:
lastChunk- The last chunk flag
-
setEmptyChunk
public void setEmptyChunk(boolean emptyChunk)
Sets the empty chunk flag.
The empty chunk flag indicates if the chunk contains an empty LOB. For LOB columns, an empty LOB column is different from a column with a NULL value. Use this method to indicate whether the column contains an empty LOB.- Specified by:
setEmptyChunkin interfaceChunkColumnValue- Parameters:
emptyChunk- The empty chunk flag
-
setXMLDiff
public void setXMLDiff(boolean xmlDiff)
Sets the XMLDiff flag.
The XMLDiff flag indicates if the chunk contains an XMLDiff.- Specified by:
setXMLDiffin interfaceChunkColumnValue- Parameters:
xmlDiff- The XMLDiff flag
-
setJSONDiff
public void setJSONDiff(boolean jsonDiff)
Sets the JsonDiff flag.
This flag indicates whether the JSON chunk is a JsonDiff.- Specified by:
setJSONDiffin interfaceChunkColumnValue- Parameters:
jsonDiff- The XMLDiff flag
-
setEndOfRow
public void setEndOfRow(boolean endOfRow)
Sets the endOfRow chunk flag.
The endOfRow flag indicates whether the chunk is the last one for the last column in an LCR, which also indicates the end of the entire row change.- Specified by:
setEndOfRowin interfaceChunkColumnValue- Parameters:
endOfRow- The endOfRow chunk flag
-
setCharSetId
public void setCharSetId(int charSetId)
Sets the character set ID for an XMLTYPE chunk.
Check oracle.sql.CharacterSet for the definition of Oracle CharacterSet Id.- Specified by:
setCharSetIdin interfaceChunkColumnValue- Parameters:
charSetId- The character set id
-
toString
public java.lang.String toString()
- Overrides:
toStringin classDefaultColumnValue
-
-