Class ModificationTally

java.lang.Object
org.tentackle.dbms.ModificationTally

public class ModificationTally extends Object
Counter to track modifications for a class/table.
The ModificationTracker maintains a list of ModificationTally-objects, one for each tracked name.
Author:
harald
  • Constructor Details

    • ModificationTally

      public ModificationTally(DbModificationTracker tracker, String trackedName)
      Creates a modification counter for a given tracked name.
      Parameters:
      tracker - the modification tracker
      trackedName - the tracked name
  • Method Details

    • getDbModification

      public DbModification getDbModification()
      Gets the modification PO.
      Returns:
      the modification PO
    • getId

      public long getId()
      Gets the ID of the counter.
      Returns:
      the unique id
    • countPending

      public void countPending(Session session)
      Adds a pending count.
      Parameters:
      session - the session persisting the modification, null if thread-local session
    • getPendingCount

      public long getPendingCount()
      Gets the pending count.
      Returns:
      the pending count, 0 if none
    • setLastSerial

      public void setLastSerial(long lastSerial)
      Sets the last serial.
      Parameters:
      lastSerial - the serial
    • getLatestSerial

      public long getLatestSerial()
      Gets the latest serial updated by this counter.
      Returns:
      the latest serial from last update plus pending count
    • performPendingCount

      public void performPendingCount()
      Performs the physical pending count if pending count > 0.
    • addToModificationTable

      public void addToModificationTable()
      Adds this counter to the modification table.
    • getModificationCount

      public long getModificationCount()
      Get the current modification count by tablename.
      Returns:
      the modification count