Class DbClient

java.lang.Object
io.camunda.migrator.impl.clients.DbClient

@Component public class DbClient extends Object
Wrapper class for IdKeyMapper database operations with exception handling. Maintains the same exception wrapping behavior as ExceptionUtils.callApi.
  • Field Details

  • Constructor Details

    • DbClient

      public DbClient()
  • Method Details

    • checkExistsByC7IdAndType

      public boolean checkExistsByC7IdAndType(String c7Id, IdKeyMapper.TYPE type)
      Checks if an entity exists in the mapping table by type and id.
    • checkHasC8KeyByC7IdAndType

      public boolean checkHasC8KeyByC7IdAndType(String c7Id, IdKeyMapper.TYPE type)
      Checks if an entity exists in the mapping table by type and id.
    • findLatestCreateTimeByType

      public Date findLatestCreateTimeByType(IdKeyMapper.TYPE type)
      Finds the latest create time by type.
    • findC8KeyByC7IdAndType

      public Long findC8KeyByC7IdAndType(String c7Id, IdKeyMapper.TYPE type)
      Finds the key by C7 ID and type.
    • findAllC7Ids

      public List<String> findAllC7Ids()
      Finds all C7 IDs.
    • updateC8KeyByC7IdAndType

      public void updateC8KeyByC7IdAndType(String c7Id, Long c8Key, IdKeyMapper.TYPE type)
      Updates a record by setting the key for an existing ID and type.
    • updateSkipReason

      public void updateSkipReason(String c7Id, IdKeyMapper.TYPE type, String skipReason)
    • insert

      public void insert(String c7Id, Long c8Key, Date createTime, IdKeyMapper.TYPE type)
      Inserts a new process instance record into the mapping table.
    • insert

      public void insert(String c7Id, Long c8Key, IdKeyMapper.TYPE type)
      Inserts a new record into the mapping table.
    • insert

      public void insert(String c7Id, Long c8Key, Date createTime, IdKeyMapper.TYPE type, String skipReason)
      Inserts a new process instance record into the mapping table.
    • listSkippedEntitiesByType

      public void listSkippedEntitiesByType(IdKeyMapper.TYPE type)
      Lists skipped entities by type with pagination and prints them.
    • fetchAndHandleSkippedForType

      public void fetchAndHandleSkippedForType(IdKeyMapper.TYPE type, Consumer<IdKeyDbModel> callback)
      Processes skipped entities with pagination.
    • countSkipped

      public Long countSkipped()
      Finds the count of skipped entities for all types
    • countSkippedByType

      public Long countSkippedByType(IdKeyMapper.TYPE type)
      Finds the count of skipped entities for the given type
    • findSkippedProcessInstances

      public List<IdKeyDbModel> findSkippedProcessInstances()
      Finds the Ids of all skipped process instances.
    • deleteAllMappings

      public void deleteAllMappings()
      Deletes all mappings from the database.
    • deleteByC7Id

      protected void deleteByC7Id(String c7Id)
      Deletes a mapping by C7 ID.
    • createIdKeyDbModel

      protected IdKeyDbModel createIdKeyDbModel(String c7Id, Date createTime, Long c8Key, IdKeyMapper.TYPE type, String skipReason)
      Creates a new IdKeyDbModel instance with the provided parameters including skip reason.
    • createIdKeyDbModel

      protected IdKeyDbModel createIdKeyDbModel(String c7Id, Date createTime, Long c8Key, IdKeyMapper.TYPE type)
      Creates a new IdKeyDbModel instance with the provided parameters.