Skip navigation links

Oracle® Database XStream Java API Reference
11g Release 2 (11.2)

E16674-02


oracle.streams
Class DefaultRowLCR

java.lang.Object
  extended by oracle.streams.AbstractLCR
      extended by oracle.streams.DefaultRowLCR

All Implemented Interfaces:
LCR, RowLCR

public class DefaultRowLCR
extends AbstractLCR
implements RowLCR

The DefaultRowLCR class provides an Oracle default implementation of the RowLCR interface.


Field Summary

 

Fields inherited from interface oracle.streams.RowLCR
DELETE, INSERT, LOB_ERASE, LOB_TRIM, LOB_WRITE

 

Constructor Summary
DefaultRowLCR()
          Constructs a RowLCR object with NULL values.
DefaultRowLCR(java.lang.String sourceDatabaseName, java.lang.String commandType, java.lang.String objectOwner, java.lang.String objectName, java.lang.String transactionId, byte[] tag, byte[] position, oracle.sql.DATE sourceTime)
          Constructs a RowLCR object with given LCR parameters.

 

Method Summary
 ColumnValue[] getBinds()
          Gets the bind values that bind the SQL statement generated using getStatement().
 java.lang.String getDateFormat()
          Gets the date format of a row LCR.
 ColumnValue[] getNewValues()
          Gets the list of new column values in a row LCR.
 ColumnValue[] getOldValues()
          Gets the list of old column values in a row LCR.
 java.lang.String getStatement(boolean bind)
          Generates a SQL statement from the row LCR.
 java.lang.String getTimeStampFormat()
          Gets the timestamp format.
 java.lang.String getWhereClause(boolean bind)
          Gets a WHERE clause for the change that is encapsulated in the row LCR.
 ColumnValue[] getWhereClauseBinds()
          Gets the bind array to be used with the WHERE clause generated by getWhereClause().
 boolean hasChunkData()
          Indicates whether this LCR contains chunk data for LOB, LONG, or XMLTYPE columns.
 boolean hasIDKeyColumnsOnly()
          Indicates whether the LCR only has identification key columns.
 boolean isSequenceLCR()
          Indicates whether the LCR is a sequence LCR, which is generated by accessing NEXTVAL of an Oracle sequence.
 void setChunkDataFlag(boolean chunkDataFlag)
          Sets the chunkDataFlag.
 void setDateFormat(java.lang.String dateFormat)
          Sets the date format that is used to convert a DATE value to a String value.
 void setIDKeyColumnsOnly(boolean IDKeyColumnsOnly)
          Sets whether or not this LCR only has identification key columns.
 void setNewValues(ColumnValue[] newValues)
          Sets the new column values list for a RowLCR.
 void setOldValues(ColumnValue[] oldValues)
          Sets the old column values list for a row LCR.
 void setSequenceLCRFlag(boolean sequenceLCRFlag)
          Sets the sequence LCR flag.
 void setTimeStampFormat(java.lang.String timeStampFormat)
          Sets the timestamp format that is used to convert a TIMESTAMP value to a String value
 java.lang.String toString()
           

 

Methods inherited from class oracle.streams.AbstractLCR
getAttribute, getAttributeName, getAttributesList, getAttributeValue, getCommandType, getCommitSCN, getMessageTrackingLabel, getNumAttributes, getObjectName, getObjectOwner, getPosition, getSCN, getSourceDatabaseName, getSourceTime, getTag, getTransactionId, setAttribute, setCommandType, setMessageTrackingLabel, setObjectName, setObjectOwner, setPosition, setSourceDatabaseName, setSourceTime, setTag, setTransactionId

 

Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait

 

Methods inherited from interface oracle.streams.LCR
getAttribute, getCommandType, getObjectName, getObjectOwner, getPosition, getSourceDatabaseName, getSourceTime, getTag, getTransactionId, setAttribute, setCommandType, setObjectName, setObjectOwner, setPosition, setSourceDatabaseName, setSourceTime, setTag, setTransactionId

 

Constructor Detail

DefaultRowLCR

public DefaultRowLCR(java.lang.String sourceDatabaseName,
                     java.lang.String commandType,
                     java.lang.String objectOwner,
                     java.lang.String objectName,
                     java.lang.String transactionId,
                     byte[] tag,
                     byte[] position,
                     oracle.sql.DATE sourceTime)
Constructs a RowLCR object with given LCR parameters.
Parameters:
sourceDatabaseName - source database name.
commandType - RowLCR command type.
objectOwner - object owner.
objectName - object name.
transactionId - transaction ID.
tag - LCR tag.
position - LCR position.
sourceTime - source timestamp.

DefaultRowLCR

public DefaultRowLCR()
Constructs a RowLCR object with NULL values.

Method Detail

getOldValues

public ColumnValue[] getOldValues()
Gets the list of old column values in a row LCR.
These are the column values for the row before the DML change. Note that the returned ColumnValue[] is mutable.
If the DML statement is an UPDATE or a DELETE statement, then this parameter contains the values of columns in the row before the DML statement.
If the DML statement is an INSERT statement, then there are no old values and NULL is returned. Note that the returned ColumnValue[] is mutable
Specified by:
getOldValues in interface RowLCR
Returns:
A ColumnValue array contains the old column value

getNewValues

public ColumnValue[] getNewValues()
Gets the list of new column values in a row LCR.
These are the column values for the row after the DML change. Note that the returned ColumnValue[] is mutable.
If the DML statement is an UPDATE or an INSERT statement, then this parameter contains the values of columns in the row after the DML statement.
If the DML statement is a DELETE statement, then there are no new values and NULL is returned.
Note that the returned ColumnValue[] is mutable
Specified by:
getNewValues in interface RowLCR
Returns:
A ColumnValue array contains the new column value

setOldValues

public void setOldValues(ColumnValue[] oldValues)
Sets the old column values list for a row LCR.
If the DML statement is an UPDATE or a DELETE statement, then set this parameter to a non-NULL value.
If the DML statement is an INSERT statement, then set this parameter to a NULL value.
Specified by:
setOldValues in interface RowLCR
Parameters:
oldValues - The old column value array

setNewValues

public void setNewValues(ColumnValue[] newValues)
Sets the new column values list for a RowLCR.
If the DML statement is an UPDATE or an INSERT statement, then set this parameter to a non-NULL value.
If the DML statement is a DELETE statement, then set this parameter to a NULL value.
Specified by:
setNewValues in interface RowLCR
Parameters:
newValues - The new column value array

hasChunkData

public boolean hasChunkData()
Indicates whether this LCR contains chunk data for LOB, LONG, or XMLTYPE columns.
If an LCR contains chunk data for LOB, LONG, or XMLTYPE columns and must use the XStreamOUT APIs for chunking, then call this method to check whether the LCR contains chunk data and invoke the XStreamOut APIs for chunking accordingly.
Specified by:
hasChunkData in interface RowLCR
Returns:
A boolean flag indicates if this LCR contains chunk data.

setChunkDataFlag

public void setChunkDataFlag(boolean chunkDataFlag)
Sets the chunkDataFlag.
If an LCR contains chunk data for LOB, LONG, or XMLTYPE columns and must use the XStreamOUT APIs for chunking, then call this method to set the chunkDataFLag to true and invoke the XStreamOut APIs for chunking accordingly.
Specified by:
setChunkDataFlag in interface RowLCR
Parameters:
chunkDataFlag - indicates whether this LCR contains chunk data.

getDateFormat

public java.lang.String getDateFormat()
Gets the date format of a row LCR.
Returns:
returns the date format set by the user.
returns null if nothing was set.

getTimeStampFormat

public java.lang.String getTimeStampFormat()
Gets the timestamp format.
Returns:
returns the timestamp format set by the user.
returns null if nothing was set.

setDateFormat

public void setDateFormat(java.lang.String dateFormat)
Sets the date format that is used to convert a DATE value to a String value.
Parameters:
dateFormat - The date format to be used to convert the date to
string. null value passed will use the default date format. The symbols used in the format string should conform to JDBC format specification. The default format is 'yyyy-MM-dd'

setTimeStampFormat

public void setTimeStampFormat(java.lang.String timeStampFormat)
Sets the timestamp format that is used to convert a TIMESTAMP value to a String value
Parameters:
timeStampFormat - The timestamp format to be used to convert the
timestamp to string. null value passed will use the default
timestamp format The symbols used in the format string should conform to JDBC format specification. The default format is 'yyyy-MM-dd HH:mm:ss.SSS'

getStatement

public java.lang.String getStatement(boolean bind)
                              throws StreamsException
Generates a SQL statement from the row LCR.
Parameters:
bind - When true, generates SQL with bind variables. When false, generates SQL with inline values. LOB values cannot be inlined. A StreamsException is thrown when set to false and the row LCR contains LOB values. This value is only used for non-statement LCRs
Returns:
The generated SQL string.
Throws:
java.sql.StreamsException - Thrown if any of the datatypes cannot be unparsed to a string or if any datatype of the columns in the table does not have JDBC equivalent.
StreamsException

getBinds

public ColumnValue[] getBinds()
Gets the bind values that bind the SQL statement generated using getStatement().
Returns:
Array of binds to be bound to the sql generated by getStatement()
The array index of the element determines the position of bind.
This method can be used after generating SQL with inlined values, but the returned bind array might be difficult to use.

getWhereClause

public java.lang.String getWhereClause(boolean bind)
                                throws StreamsException
Gets a WHERE clause for the change that is encapsulated in the row LCR. The WHERE clause generated identifes the row that this lcr is operating on. Use this method when an LCR contains a LOB column and multiple SQL statements must be generated for piecewise LOB operaions.
Parameters:
bind - When true, generates SQL with bind variables. When false, generates SQL with inline values. LOB values cannot be inlined. A StreamsException is thrown when set to false and the row LCR contains LOB values.
Returns:
returns generated where clause, which includes the 'WHERE' keyword
Throws:
java.sql.StreamsException - Thrown if any of the datatypes cannot be unparsed to a string or if any datatype of the columns in the table does not have JDBC equivalent.
StreamsException

getWhereClauseBinds

public ColumnValue[] getWhereClauseBinds()
Gets the bind array to be used with the WHERE clause generated by getWhereClause().
Returns:
Array of ColumnValue containing the bind columns in the bind order

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

setSequenceLCRFlag

public void setSequenceLCRFlag(boolean sequenceLCRFlag)
Sets the sequence LCR flag.
Parameters:
sequenceLCRFlag - indicates whether this LCR is a sequence LCR, which is generated by accessing NEXTVAL of an Oracle sequence.

isSequenceLCR

public boolean isSequenceLCR()
Indicates whether the LCR is a sequence LCR, which is generated by accessing NEXTVAL of an Oracle sequence.
Returns:
true if this LCR is a sequence LCR.

hasIDKeyColumnsOnly

public boolean hasIDKeyColumnsOnly()
Indicates whether the LCR only has identification key columns. Note that this LCR is incomplete, it is expected that the client will use the identification colums and rowid to query the source database for the full set of columns.
Returns:
true if this LCR only has identification key columns.

setIDKeyColumnsOnly

public void setIDKeyColumnsOnly(boolean IDKeyColumnsOnly)
Sets whether or not this LCR only has identification key columns.
Parameters:
IDKeyColumnsOnly - indicates whether this LCR only has identification columns. Note this is not typically expected to be true.

Skip navigation links

Oracle® Database XStream Java API Reference
11g Release 2 (11.2)

E16674-02


Copyright © 2009, 2010, Oracle and/or its affiliates. All Rights Reserved.