public interface LockingAndVersioningRepository<T,ID extends Serializable>
| Modifier and Type | Method and Description |
|---|---|
void |
delete(T entity)
Deletes a given entity version.
|
void |
deleteAllVersions(T entity)
Deletes all versions of the given entity.
|
<S extends T> |
findAllVersions(S entity)
Returns a list of all versions for the given entity.
|
<S extends T> |
findAllVersions(S entity,
org.springframework.data.domain.Sort sort)
Returns a sorted list of all versions for the given entity
|
<S extends T> |
findAllVersionsLatest()
Deprecated.
|
<S extends T> |
findAllVersionsLatest(Class<S> entityClass)
Returns the latest version of all entities.
|
<S extends T> |
findWorkingCopy(S entity)
Returns the working copy for the given entity if it exists.
|
<S extends T> |
isPrivateWorkingCopy(S entity)
Returns whether the given entity is a private working copy, or not
|
<S extends T> |
lock(S entity)
Locks the entity and returns the updated entity (@Version and @LockOwner) attributes updated, otherwise
returns null.
|
<S extends T> |
save(S entity)
Overridden implementation of save that enforces locking semantics
|
<S extends T> |
unlock(S entity)
Unlocks the entity and returns the updated entity (@Version and @LockOwner) attributes updated, otherwise
returns null
|
<S extends T> |
version(S entity,
VersionInfo info)
Creates and returns a new version of the entity.
|
<S extends T> |
workingCopy(S entity)
Creates and returns a new version of the entity as a private working copy.
|
<S extends T> S lock(S entity)
S - the type of entityentity - the entity to be lockedSecurityException - if no authentication exists<S extends T> S unlock(S entity)
S - the type of entityentity - the entity to unlockLockOwnerException - if the current principal is not the lock ownerSecurityException - if no authentication exists<S extends T> S save(S entity)
S - the type of entityentity - the entity to saveLockOwnerException - if the current principal is not the lock ownerSecurityException - if no authentication exists<S extends T> S workingCopy(S entity)
S - the type of entityentity - the entity to base the new versionWithEntity onLockingAndVersioningException - if entity is not the latestLockOwnerException - if the current principal is not the lock ownerSecurityException - if no authentication exists<S extends T> S version(S entity, VersionInfo info)
S - the type of entityentity - the entity to base the new versionWithEntity oninfo - the version infoLockingAndVersioningException - if entity is not the latestLockOwnerException - if the current principal is not the lock ownerSecurityException - if no authentication exists@Deprecated <S extends T> List<S> findAllVersionsLatest()
S - the type of entity<S extends T> List<S> findAllVersionsLatest(Class<S> entityClass)
S - the type of entityentityClass - the type of the entity to find<S extends T> List<S> findAllVersions(S entity)
S - the type of entityentity - the entity to find versions for<S extends T> List<S> findAllVersions(S entity, org.springframework.data.domain.Sort sort)
S - the type of entityentity - the entity to find versions forsort - the sort to applyvoid delete(T entity)
entity - the entity to deleteLockingAndVersioningException - if entity is not the latestLockOwnerException - if the current principal is not the lock ownerSecurityException - if no authentication existsvoid deleteAllVersions(T entity)
entity - the entity to delete<S extends T> boolean isPrivateWorkingCopy(S entity)
S - the type of entityentity - the entity to delete<S extends T> S findWorkingCopy(S entity)
S - the type of entityentity - the entity whose working copy is requiredCopyright © 2021 Paul Warren. All rights reserved.