public Commit createTerminal(String author, Object removed) { Validate.argumentsAreNotNull(author, removed); Cdo removedCdo = liveGraphFactory.createCdo(removed); return createTerminalByGlobalId(author, removedCdo.getGlobalId()); }
public Commit create(String author, Object currentVersion) { Validate.argumentsAreNotNull(author, currentVersion); CommitMetadata commitMetadata = nextCommit(author); LiveGraph currentGraph = liveGraphFactory.createLiveGraph(currentVersion); ShadowGraph latestShadowGraph = graphSnapshotFacade.createLatestShadow(currentGraph); // capture current state List<CdoSnapshot> snapshots = graphSnapshotFacade.createGraphSnapshot(currentGraph, latestShadowGraph, commitMetadata); // do diff Diff diff = diffFactory.create(latestShadowGraph, currentGraph, Optional.of(commitMetadata)); return new Commit(commitMetadata, snapshots, diff); }
public Commit createTerminalByGlobalId(String author, GlobalId removedId) { Validate.argumentsAreNotNull(author, removedId); Optional<CdoSnapshot> previousSnapshot = javersRepository.getLatest(removedId); if (previousSnapshot.isEmpty()) { throw new JaversException( JaversExceptionCode.CANT_DELETE_OBJECT_NOT_FOUND, removedId.value()); } CommitMetadata commitMetadata = nextCommit(author); CdoSnapshot terminalSnapshot = snapshotFactory.createTerminal(removedId, previousSnapshot.get(), commitMetadata); Diff diff = diffFactory.singleTerminal(removedId, commitMetadata); return new Commit(commitMetadata, Lists.asList(terminalSnapshot), diff); }
@Override public Object getPropertyValue(String propertyName) { Validate.argumentIsNotNull(propertyName); Property property = getManagedType().getProperty(propertyName); return property.get(wrappedCdo); }
public Object getPropertyValue(String propertyName) { Validate.argumentIsNotNull(propertyName); Property property = getGlobalId().getCdoClass().getProperty(propertyName); return getPropertyValue(property); }
protected Cdo(GlobalId globalId) { Validate.argumentIsNotNull(globalId); this.globalId = globalId; }
Commit(CommitMetadata commitMetadata, List<CdoSnapshot> snapshots, Diff diff) { Validate.argumentsAreNotNull(commitMetadata, snapshots, diff); this.commitMetadata = commitMetadata; this.snapshots = snapshots; this.diff = diff; }
ManagedClassFactory( PropertyScanner propertyScanner, ClassAnnotationsScanner classAnnotationsScanner) { Validate.argumentsAreNotNull(propertyScanner); this.propertyScanner = propertyScanner; this.classAnnotationsScanner = classAnnotationsScanner; }