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 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.java.math.BigInteger
getChunkOffset()
Gets the chunk operation offset.java.math.BigInteger
getChunkOperationSize()
Gets the chunk operation size.int
getChunkType()
Gets the chunk type.oracle.sql.Datum
getUpdatedRowId()
Gets the updated rowid after receiving all chunks for the row.boolean
isEmptyChunk()
Indicates whether the chunk is empty.boolean
isEndOfRow()
Indicates whether the chunk is the end of the entire row change.boolean
isJSONDiff()
Indicates whether the chunk is a JSONDiff.boolean
isLastChunk()
Indicates whether the chunk is the last one for the column.boolean
isXMLDiff()
Indicates whether the chunk is an XMLDiff.void
setCharSetId(int charSetId)
Sets the character set ID for an XMLTYPE chunk.void
setChunkOffset(java.math.BigInteger chunkOffset)
Sets the chunk operation offset.void
setChunkOperationSize(java.math.BigInteger chunkOperationSize)
Sets the chunk operation size.void
setChunkType(int chunkType)
Sets the chunk type.void
setColumnData(oracle.sql.Datum columnData)
Sets the column data for a ChunkColumnValue.void
setColumnData(oracle.sql.Datum columnData, int columnDataType)
Sets the column data.void
setEmptyChunk(boolean emptyChunk)
Sets the empty chunk flag.void
setEndOfRow(boolean endOfRow)
Sets the endOfRow chunk flag.void
setJSONDiff(boolean jsonDiff)
Sets the JsonDiff flag.void
setLastChunk(boolean lastChunk)
Sets the last chunk flag.void
setUpdatedRowId(oracle.sql.Datum updatedRowId)
Updates the rowid when chunk is the end of row.void
setXMLDiff(boolean xmlDiff)
Sets the XMLDiff flag.java.lang.String
toString()
-
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 StreamsException
Constructs 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 StreamsException
Constructs 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:
getChunkType
in interfaceChunkColumnValue
- Returns:
- A integer contains the chunk type as defined in ChunkColumnValue
-
setChunkType
public void setChunkType(int chunkType) throws StreamsException
Sets 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:
setChunkType
in 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:
getUpdatedRowId
in 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:
setUpdatedRowId
in 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 StreamsException
Sets 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:
setColumnData
in interfaceColumnValue
- Overrides:
setColumnData
in 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:
getChunkOffset
in 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:
getCharSetId
in 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:
setChunkOffset
in 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:
getChunkOperationSize
in 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:
setChunkOperationSize
in interfaceChunkColumnValue
- Parameters:
chunkOperationSize
- The chunk operation size
-
isLastChunk
public boolean isLastChunk()
Indicates whether the chunk is the last one for the column.- Specified by:
isLastChunk
in 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:
isEmptyChunk
in 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:
isXMLDiff
in interfaceChunkColumnValue
- Returns:
- a boolean flag indicates if this is an XMLDiff
-
isJSONDiff
public boolean isJSONDiff()
Indicates whether the chunk is a JSONDiff.- Specified by:
isJSONDiff
in 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:
isEndOfRow
in 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:
setLastChunk
in 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:
setEmptyChunk
in 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:
setXMLDiff
in 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:
setJSONDiff
in 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:
setEndOfRow
in 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:
setCharSetId
in interfaceChunkColumnValue
- Parameters:
charSetId
- The character set id
-
toString
public java.lang.String toString()
- Overrides:
toString
in classDefaultColumnValue
-
-