Class CdoSnapshot


  • public final class CdoSnapshot
    extends Cdo
    Historical state of a domain object captured as the property->value Map. Values and primitives are stored 'by value'. Referenced Entities and ValueObjects are stored 'by reference' using GlobalId
    • Method Detail

      • getWrappedCdo

        public java.util.Optional<java.lang.Object> getWrappedCdo()
        Specified by:
        getWrappedCdo in class Cdo
        Returns:
        Optional.EMPTY
      • size

        public int size()
      • getPropertyValue

        public java.lang.Object getPropertyValue​(java.lang.String propertyName)
        Specified by:
        getPropertyValue in class Cdo
      • getPropertyValue

        public java.lang.Object getPropertyValue​(Property property)
        returns default values for null primitives
        Specified by:
        getPropertyValue in class Cdo
      • getChanged

        public java.util.List<java.lang.String> getChanged()
        List of propertyNames changed with this snapshot (comparing to latest from repository).
        For initial snapshot, returns all properties.
      • hasChangeAt

        public boolean hasChangeAt​(java.lang.String propertyName)
      • isNull

        public boolean isNull​(Property property)
        Specified by:
        isNull in class Cdo
      • getCommitId

        public CommitId getCommitId()
      • stateEquals

        public boolean stateEquals​(java.lang.Object o)
      • isInitial

        public boolean isInitial()
      • isTerminal

        public boolean isTerminal()
      • getVersion

        public long getVersion()
        Object version number.
        Initial snapshot of given object has version 1, next has version 2.

        Warning! Version field was added in JaVers v. 1.4.4. All snapshots persisted in JaversRepository before this release have version 0.
        If it isn't OK for you, run manual DB update. See release-notes for v. 1.4.4
        Since:
        1.4.4
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class Cdo
      • stateWithAllPrimitives

        public CdoSnapshotState stateWithAllPrimitives()
        Original state enriched with default primitive values (like boolean false).