Class AbstractDatabaseWriter
java.lang.Object
org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter
- All Implemented Interfaces:
IDataResource,IDataWriter
- Direct Known Subclasses:
DefaultDatabaseWriter,HbaseDatabaseWriter
-
Nested Class Summary
Nested Classes -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected Batchstatic final Stringstatic final Stringprotected IDatabaseWriterConflictResolverprotected DataContextprotected booleanprotected booleanprotected CsvDataprotected booleanprotected Tableprotected Map<Batch,Statistics> protected Tablestatic final Stringprotected longprotected DatabaseWriterSettings -
Constructor Summary
ConstructorsConstructorDescriptionAbstractDatabaseWriter(DatabaseWriterSettings settings) AbstractDatabaseWriter(IDatabaseWriterConflictResolver conflictResolver, DatabaseWriterSettings settings) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidallowInsertIntoAutoIncrementColumns(boolean value, Table table) protected voidbindVariables(Map<String, Object> variables) protected voidvoidclose()protected voidcommit(boolean earlyCommit) protected abstract booleanprotected abstract AbstractDatabaseWriter.LoadStatusvoidvoidprotected voidfilterAfter(CsvData data) protected booleanfilterBefore(CsvData data) protected booleanfilterError(CsvData data, Exception ex) getBatch()getLookupDataMap(CsvData data, Conflict conflict) protected StringgetPkDataFor(CsvData data, Column column) protected String[]getRowData(CsvData data, String dataType) protected booleanprotected abstract AbstractDatabaseWriter.LoadStatusprotected abstract voidlogFailureDetails(Throwable e, CsvData data, boolean logLastDmlDetails) protected TablelookupTableAtTarget(Table sourceTable) protected voidprotected voidprotected voidprotected voidvoidopen(DataContext context) protected voidrollback()protected booleanvoidsetConflictResolver(IDatabaseWriterConflictResolver conflictResolver) protected abstract booleanbooleanvoidprotected voidtargetTableWasChangedByFilter(Table oldTargetTable) protected abstract AbstractDatabaseWriter.LoadStatusvoid
-
Field Details
-
CONFLICT_ERROR
- See Also:
-
TRANSACTION_ABORTED
- See Also:
-
CONFLICT_IGNORE
- See Also:
-
lastUseConflictDetection
protected boolean lastUseConflictDetection -
lastApplyChangesOnly
protected boolean lastApplyChangesOnly -
isRequiresSavePointsInTransaction
protected boolean isRequiresSavePointsInTransaction -
sourceTable
-
targetTable
-
targetTables
-
lastData
-
batch
-
context
-
uncommittedCount
protected long uncommittedCount -
writerSettings
-
statistics
-
conflictResolver
-
missingTables
-
-
Constructor Details
-
AbstractDatabaseWriter
public AbstractDatabaseWriter() -
AbstractDatabaseWriter
-
AbstractDatabaseWriter
public AbstractDatabaseWriter(IDatabaseWriterConflictResolver conflictResolver, DatabaseWriterSettings settings)
-
-
Method Details
-
open
- Specified by:
openin interfaceIDataResource
-
start
- Specified by:
startin interfaceIDataWriter
-
start
- Specified by:
startin interfaceIDataWriter
-
write
- Specified by:
writein interfaceIDataWriter
-
checkForEarlyCommit
protected void checkForEarlyCommit() -
commit
protected void commit(boolean earlyCommit) -
rollback
protected void rollback() -
filterError
-
filterBefore
-
targetTableWasChangedByFilter
-
notifyFiltersEarlyCommit
protected void notifyFiltersEarlyCommit() -
notifyFiltersBatchComplete
protected void notifyFiltersBatchComplete() -
notifyFiltersBatchCommitted
protected void notifyFiltersBatchCommitted() -
notifyFiltersBatchRolledback
protected void notifyFiltersBatchRolledback() -
filterAfter
-
insert
-
delete
protected abstract AbstractDatabaseWriter.LoadStatus delete(CsvData data, boolean useConflictDetection) -
update
protected abstract AbstractDatabaseWriter.LoadStatus update(CsvData data, boolean applyChangesOnly, boolean useConflictDetection) -
create
-
sql
-
logFailureDetails
-
getRowData
-
bindVariables
-
script
-
getLookupDataMap
-
getPkDataFor
-
end
- Specified by:
endin interfaceIDataWriter
-
end
- Specified by:
endin interfaceIDataWriter
-
close
public void close()- Specified by:
closein interfaceIDataResource
-
hasFilterThatHandlesMissingTable
-
allowInsertIntoAutoIncrementColumns
-
lookupTableAtTarget
-
getBatch
-
getContext
-
getConflictResolver
-
setConflictResolver
-
getTargetTable
-
getSourceTable
-
getStatistics
- Specified by:
getStatisticsin interfaceIDataResource
-
getWriterSettings
-