Class AbstractDatabaseWriter

java.lang.Object
org.jumpmind.symmetric.io.data.writer.AbstractDatabaseWriter
All Implemented Interfaces:
IDataResource, IDataWriter
Direct Known Subclasses:
DefaultDatabaseWriter, HbaseDatabaseWriter

public abstract class AbstractDatabaseWriter extends Object implements IDataWriter
  • Field Details

    • CONFLICT_ERROR

      public static final String CONFLICT_ERROR
      See Also:
    • TRANSACTION_ABORTED

      public static final String TRANSACTION_ABORTED
      See Also:
    • CONFLICT_IGNORE

      public static final String CONFLICT_IGNORE
      See Also:
    • lastUseConflictDetection

      protected boolean lastUseConflictDetection
    • lastApplyChangesOnly

      protected boolean lastApplyChangesOnly
    • isRequiresSavePointsInTransaction

      protected boolean isRequiresSavePointsInTransaction
    • sourceTable

      protected Table sourceTable
    • targetTable

      protected Table targetTable
    • targetTables

      protected Map<String,Table> targetTables
    • lastData

      protected CsvData lastData
    • batch

      protected Batch batch
    • context

      protected DataContext context
    • uncommittedCount

      protected long uncommittedCount
    • writerSettings

      protected DatabaseWriterSettings writerSettings
    • statistics

      protected Map<Batch,Statistics> statistics
    • conflictResolver

      protected IDatabaseWriterConflictResolver conflictResolver
    • missingTables

      protected Set<String> missingTables
  • Constructor Details

  • Method Details

    • open

      public void open(DataContext context)
      Specified by:
      open in interface IDataResource
    • start

      public void start(Batch batch)
      Specified by:
      start in interface IDataWriter
    • start

      public boolean start(Table table)
      Specified by:
      start in interface IDataWriter
    • write

      public void write(CsvData data)
      Specified by:
      write in interface IDataWriter
    • checkForEarlyCommit

      protected void checkForEarlyCommit()
    • commit

      protected void commit(boolean earlyCommit)
    • rollback

      protected void rollback()
    • filterError

      protected boolean filterError(CsvData data, Exception ex)
    • filterBefore

      protected boolean filterBefore(CsvData data)
    • targetTableWasChangedByFilter

      protected void targetTableWasChangedByFilter(Table oldTargetTable)
    • notifyFiltersEarlyCommit

      protected void notifyFiltersEarlyCommit()
    • notifyFiltersBatchComplete

      protected void notifyFiltersBatchComplete()
    • notifyFiltersBatchCommitted

      protected void notifyFiltersBatchCommitted()
    • notifyFiltersBatchRolledback

      protected void notifyFiltersBatchRolledback()
    • filterAfter

      protected void filterAfter(CsvData data)
    • insert

      protected abstract AbstractDatabaseWriter.LoadStatus insert(CsvData data)
    • delete

      protected abstract AbstractDatabaseWriter.LoadStatus delete(CsvData data, boolean useConflictDetection)
    • update

      protected abstract AbstractDatabaseWriter.LoadStatus update(CsvData data, boolean applyChangesOnly, boolean useConflictDetection)
    • create

      protected abstract boolean create(CsvData data)
    • sql

      protected abstract boolean sql(CsvData data)
    • logFailureDetails

      protected abstract void logFailureDetails(Throwable e, CsvData data, boolean logLastDmlDetails)
    • getRowData

      protected String[] getRowData(CsvData data, String dataType)
    • bindVariables

      protected void bindVariables(Map<String,Object> variables)
    • script

      protected boolean script(CsvData data)
    • getLookupDataMap

      protected Map<String,String> getLookupDataMap(CsvData data, Conflict conflict)
    • getPkDataFor

      protected String getPkDataFor(CsvData data, Column column)
    • end

      public void end(Table table)
      Specified by:
      end in interface IDataWriter
    • end

      public void end(Batch batch, boolean inError)
      Specified by:
      end in interface IDataWriter
    • close

      public void close()
      Specified by:
      close in interface IDataResource
    • hasFilterThatHandlesMissingTable

      protected boolean hasFilterThatHandlesMissingTable(Table table)
    • allowInsertIntoAutoIncrementColumns

      protected void allowInsertIntoAutoIncrementColumns(boolean value, Table table)
    • lookupTableAtTarget

      protected Table lookupTableAtTarget(Table sourceTable)
    • getBatch

      public Batch getBatch()
    • getContext

      public DataContext getContext()
    • getConflictResolver

      public IDatabaseWriterConflictResolver getConflictResolver()
    • setConflictResolver

      public void setConflictResolver(IDatabaseWriterConflictResolver conflictResolver)
    • getTargetTable

      public Table getTargetTable()
    • getSourceTable

      public Table getSourceTable()
    • getStatistics

      public Map<Batch,Statistics> getStatistics()
      Specified by:
      getStatistics in interface IDataResource
    • getWriterSettings

      public DatabaseWriterSettings getWriterSettings()