Class Commit

java.lang.Object
org.javers.core.commit.Commit

public final class Commit extends Object
JaVers commit is a similar concept to GIT commit. It records snapshots of changed domain objects.

One commit can affect one or more domain objects.

Commit holds following data:
  • Method Details

    • getId

      public CommitId getId()
      Monotonically increasing id, e.g. 1.0, 2.0, ...
    • getAuthor

      public String getAuthor()
    • getProperties

      public Map<String,String> getProperties()
    • getCommitDate

      public LocalDateTime getCommitDate()
      Commit creation timestamp in local time zone
    • getCommitDateInstant

      public Instant getCommitDateInstant()
      Commit creation timestamp in UTC.

      Since 5.1, commitDateInstant is persisted in JaversRepository to provide reliable chronological ordering, especially when CommitIdGenerator.RANDOM is used.

      Commits persisted by JaVers older then 5.1 have commitDateInstant guessed from commitDate and current TimeZone
      Since:
      5.1
    • getSnapshots

      public List<CdoSnapshot> getSnapshots()
      Returns:
      unmodifiableList
    • getChanges

      public Changes getChanges()
      Returns:
      unmodifiableList
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • equals

      public boolean equals(Object o)
      Overrides:
      equals in class Object
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object