Package org.javers.repository.inmemory
Class InMemoryRepository
- java.lang.Object
-
- org.javers.repository.inmemory.InMemoryRepository
-
- All Implemented Interfaces:
JaversRepository
public class InMemoryRepository extends java.lang.Object implements JaversRepository
Fake impl of JaversRepository
-
-
Constructor Summary
Constructors Constructor Description InMemoryRepository()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
ensureSchema()
Called at the end of JaVers bootstrap, good place to put database schema updateCommitId
getHeadId()
java.util.Optional<CdoSnapshot>
getLatest(GlobalId globalId)
Latest snapshot of a given object.java.util.List<CdoSnapshot>
getSnapshots(java.util.Collection<SnapshotIdentifier> snapshotIdentifiers)
Snapshots with specified globalId and versionjava.util.List<CdoSnapshot>
getSnapshots(QueryParams queryParams)
Snapshots of all objects in reverse chronological orderjava.util.List<CdoSnapshot>
getStateHistory(java.util.Set<ManagedType> givenClasses, QueryParams queryParams)
All snapshots of objects within given managed classes, in reverse chronological orderjava.util.List<CdoSnapshot>
getStateHistory(GlobalId globalId, QueryParams queryParams)
Snapshots (historical states) of given object in reverse chronological orderjava.util.List<CdoSnapshot>
getValueObjectStateHistory(EntityType ownerEntity, java.lang.String path, QueryParams queryParams)
Snapshots of all ValueObjects owned by given ownerEntity at given pathboolean
hasInstants(QueryParams q)
boolean
isDateInRange(QueryParams q, java.time.LocalDateTime date)
void
persist(Commit commit)
void
setJsonConverter(JsonConverter jsonConverter)
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface org.javers.repository.api.JaversRepository
getLatest
-
-
-
-
Method Detail
-
getValueObjectStateHistory
public java.util.List<CdoSnapshot> getValueObjectStateHistory(EntityType ownerEntity, java.lang.String path, QueryParams queryParams)
Description copied from interface:JaversRepository
Snapshots of all ValueObjects owned by given ownerEntity at given path- Specified by:
getValueObjectStateHistory
in interfaceJaversRepository
-
getStateHistory
public java.util.List<CdoSnapshot> getStateHistory(GlobalId globalId, QueryParams queryParams)
Description copied from interface:JaversRepository
Snapshots (historical states) of given object in reverse chronological order- Specified by:
getStateHistory
in interfaceJaversRepository
queryParams
- parameters constraining returned list (size limit, util from/to)- Returns:
- empty List if object is not versioned
-
getStateHistory
public java.util.List<CdoSnapshot> getStateHistory(java.util.Set<ManagedType> givenClasses, QueryParams queryParams)
Description copied from interface:JaversRepository
All snapshots of objects within given managed classes, in reverse chronological order- Specified by:
getStateHistory
in interfaceJaversRepository
queryParams
- parameters constraining returned list (size limit, util from/to)- Returns:
- empty List if no snapshots found
-
isDateInRange
public boolean isDateInRange(QueryParams q, java.time.LocalDateTime date)
-
getLatest
public java.util.Optional<CdoSnapshot> getLatest(GlobalId globalId)
Description copied from interface:JaversRepository
Latest snapshot of a given object.
Optional#EMPTY if object is not versioned- Specified by:
getLatest
in interfaceJaversRepository
-
getSnapshots
public java.util.List<CdoSnapshot> getSnapshots(QueryParams queryParams)
Description copied from interface:JaversRepository
Snapshots of all objects in reverse chronological order- Specified by:
getSnapshots
in interfaceJaversRepository
- Parameters:
queryParams
- parameters constraining returned list (size limit, util from/to)
-
getSnapshots
public java.util.List<CdoSnapshot> getSnapshots(java.util.Collection<SnapshotIdentifier> snapshotIdentifiers)
Description copied from interface:JaversRepository
Snapshots with specified globalId and version- Specified by:
getSnapshots
in interfaceJaversRepository
-
persist
public void persist(Commit commit)
- Specified by:
persist
in interfaceJaversRepository
-
getHeadId
public CommitId getHeadId()
- Specified by:
getHeadId
in interfaceJaversRepository
-
setJsonConverter
public void setJsonConverter(JsonConverter jsonConverter)
- Specified by:
setJsonConverter
in interfaceJaversRepository
-
ensureSchema
public void ensureSchema()
Description copied from interface:JaversRepository
Called at the end of JaVers bootstrap, good place to put database schema update- Specified by:
ensureSchema
in interfaceJaversRepository
-
hasInstants
public boolean hasInstants(QueryParams q)
-
-