Class CompositionHistoryAccess

java.lang.Object
org.ehrbase.dao.access.support.DataAccess
org.ehrbase.dao.access.jooq.CompositionHistoryAccess
All Implemented Interfaces:
I_Compensatable, I_CompositionHistoryAccess, I_DomainAccess, I_SimpleCRUD

public class CompositionHistoryAccess extends DataAccess implements I_CompositionHistoryAccess
Stripped down DAO to perform some `*_history` table related actions. Composition access handling in general is done through the CompositionAccess class.
  • Constructor Details

    • CompositionHistoryAccess

      public CompositionHistoryAccess(I_DomainAccess domainAccess, String tenantIdentifier)
  • Method Details

    • getDataAccess

      public DataAccess getDataAccess()
      Specified by:
      getDataAccess in interface I_DomainAccess
    • commit

      public UUID commit(Timestamp transactionTime)
      Description copied from interface: I_SimpleCRUD
      storeComposition a new entry in the DB
      Specified by:
      commit in interface I_SimpleCRUD
      Returns:
      the UUID of the newly created record
    • commit

      public UUID commit()
      Description copied from interface: I_SimpleCRUD
      storeComposition a new entry in the DB, using a default transaction time
      only implemented with "root" tables: ehr, contribution and composition!
      Specified by:
      commit in interface I_SimpleCRUD
      Returns:
      the UUID of the newly created record
    • update

      public Boolean update(Timestamp transactionTime)
      Description copied from interface: I_SimpleCRUD
      updateComposition the current entry
      depending on the implementation, records are updated only if one or more field(s) have been changed
      Specified by:
      update in interface I_SimpleCRUD
      Returns:
    • update

      public Boolean update(Timestamp transactionTime, boolean force)
      Description copied from interface: I_SimpleCRUD
      updateComposition the current entry even if the record is not modified
      intended to be used with temporal tables to ensure that a set of interdependent tables are updated in sync. This approach is used to simplify versions retrieval.
      Specified by:
      update in interface I_SimpleCRUD
      Returns:
    • update

      public Boolean update()
      Description copied from interface: I_SimpleCRUD
      updateComposition the current entry using time now as the system transaction time
      only implemented at root level object (contribution, composition, ehr). depending on the implementation, records are updated only if one or more field(s) have been changed
      Specified by:
      update in interface I_SimpleCRUD
      Returns:
    • update

      public Boolean update(Boolean force)
      Description copied from interface: I_SimpleCRUD
      updateComposition the current entry using time now as the system transaction time
      only implemented at root level object (contribution, composition, ehr). depending on the implementation, records are updated only if one or more field(s) have been changed
      Specified by:
      update in interface I_SimpleCRUD
      Returns:
    • delete

      public Integer delete()
      Description copied from interface: I_SimpleCRUD
      delete the Versioned Object associated with the instance implementing this Data Access Interface. Relies on ON DELETE CASCADE
      Specified by:
      delete in interface I_SimpleCRUD
      Returns:
    • retrieveByVersion

      public static I_CompositionHistoryAccess retrieveByVersion(I_DomainAccess domainAccess, UUID compositionId, int version)
    • retrieveLatest

      public static I_CompositionHistoryAccess retrieveLatest(I_DomainAccess domainAccess, UUID compositionId)
      Description copied from interface: I_CompositionHistoryAccess
      Creates DAO object with the latest existing history record matching the given composition ID.
      Parameters:
      domainAccess - Config
      compositionId - Composition ID
      Returns:
      DAO instance or null if no history is available
    • setRecord

      public void setRecord(CompositionHistoryRecord record)
      Specified by:
      setRecord in interface I_CompositionHistoryAccess
    • getRecord

      public CompositionHistoryRecord getRecord()
      Specified by:
      getRecord in interface I_CompositionHistoryAccess
    • setInContribution

      public void setInContribution(UUID contribution)
      Specified by:
      setInContribution in interface I_CompositionHistoryAccess
    • setHasAudit

      public void setHasAudit(UUID audit)
      Specified by:
      setHasAudit in interface I_CompositionHistoryAccess
    • getSysTransaction

      public Timestamp getSysTransaction()
      Specified by:
      getSysTransaction in interface I_Compensatable
    • getContributionId

      public UUID getContributionId()
      Specified by:
      getContributionId in interface I_Compensatable
    • getId

      public UUID getId()
      Specified by:
      getId in interface I_Compensatable