|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.afcs.warts.db.DataSynchronization
org.afcs.warts.db.DataSynchronizationAction
The DataSynchronizationAction class is used to
synchronize the contents of one dataset with another based on the analysis
performed by a DataComparison
instance.
LICENSE: This code is released to the public domain and may be used for any purpose whatsoever without permission or acknowledgment.
Field Summary | |
protected DataComparison |
_comparison
A reference to the comparison we're working with. |
protected TableDescription |
_destDescription
The description of the table we're going to be manipulating. |
protected java.lang.String |
_destQualTableName
The fully qualified name of the destination table (this is used in comments and debugging messages). |
protected java.lang.String |
_sourceQualTableName
The fully qualified name of the source table that data is being moved from (this is used in comments and debugging messages). |
Constructor Summary | |
DataSynchronizationAction(DataComparison comparison)
Initialises a new instance that will synchronize datasets based on the specified data comparison. |
Method Summary | |
protected int |
countRowsOfType(int[] rowIndices,
int type)
Returns the number of rows in the specified array of indices that are of the specified type in the current comparison. |
java.lang.String |
performDeletes(int[] rowsToSync)
Deletes any rows found in dataset two from the referenced destination table that weren't in dataset one when the data comparison was performed and that have indices in the specified array. |
java.lang.String |
performInserts(int[] rowsToSync)
Inserts any rows found in dataset one that weren't in dataset two when the data comparison was performed and that have indices in the specified array into the destination table. |
java.lang.String |
performSync(int[] rowsToSync,
boolean doDeletes,
boolean doUpdates,
boolean doInserts)
This method attempts to synchronize the data in all of the specified rows that require the operations permitted by the specified boolean flags. |
java.lang.String |
performUpdates(int[] rowsToSync)
Updates any rows found in both dataset one and two but with differing non-primary key column values when the data comparison was performed and that have indices in the specified array. |
java.lang.String |
toString()
Returns a textual representation of the current instance useful for debugging. |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
protected final DataComparison _comparison
protected final TableDescription _destDescription
protected final java.lang.String _destQualTableName
protected final java.lang.String _sourceQualTableName
Constructor Detail |
public DataSynchronizationAction(DataComparison comparison)
comparison
- The comparison to generate scripts for.
java.lang.NullPointerException
- If comparison is null.Method Detail |
public java.lang.String performSync(int[] rowsToSync, boolean doDeletes, boolean doUpdates, boolean doInserts)
rowsToSync
- The indices of the rows to synchronize. If this is null,
then all rows will be scanned.doDeletes
- Whether deletes should be performed.doUpdates
- Whether updates should be performed.doInserts
- Whether inserts should be performed.
public java.lang.String performDeletes(int[] rowsToSync)
rowsToSync
- The indices of the rows to synchronize. Only the row
indices that represent deleted rows will be handled.
If this is null, then all rows will be scanned.
public java.lang.String performInserts(int[] rowsToSync)
rowsToSync
- The indices of the rows to synchronize. Only the row
indices that represent inserted rows will be handled.
If this is null, then all rows will be scanned.
public java.lang.String performUpdates(int[] rowsToSync)
rowsToSync
- The indices of the rows to synchronize. Only the row
indices that represent updated rows will be handled.
If this is null, then all rows will be scanned.
public java.lang.String toString()
protected int countRowsOfType(int[] rowIndices, int type)
rowIndices
- The array of row indices to scan.type
- The row type to count.
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |