Interface IWriter<T extends org.pipservices3.commons.data.IIdentifiable<K>,K>

All Known Implementing Classes:
IdentifiableFilePersistence, IdentifiableMemoryPersistence

public interface IWriter<T extends org.pipservices3.commons.data.IIdentifiable<K>,K>
Interface for data processing components that can create, update and delete data items.
  • Method Summary

    Modifier and Type
    Method
    Description
    create(String correlationId, T entity)
    Creates a data item.
    deleteById(String correlationId, K id)
    Deleted a data item by it's unique id.
    update(String correlationId, T entity)
    Updates a data item.
  • Method Details

    • create

      T create(String correlationId, T entity) throws org.pipservices3.commons.errors.ApplicationException
      Creates a data item.
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      entity - an item to be created.
      Returns:
      created item.
      Throws:
      org.pipservices3.commons.errors.ApplicationException - when error occured.
    • update

      T update(String correlationId, T entity) throws org.pipservices3.commons.errors.ApplicationException
      Updates a data item.
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      entity - an item to be updated.
      Returns:
      updated item.
      Throws:
      org.pipservices3.commons.errors.ApplicationException - when error occured.
    • deleteById

      T deleteById(String correlationId, K id) throws org.pipservices3.commons.errors.ApplicationException
      Deleted a data item by it's unique id.
      Parameters:
      correlationId - (optional) transaction id to trace execution through call chain.
      id - an id of the item to be deleted
      Returns:
      deleted item by unique id.
      Throws:
      org.pipservices3.commons.errors.ApplicationException - when error occured.