public interface CustomizedUserPermissionRepository<D>
extends com.broadleafcommerce.common.extension.DomainTypeAware
UserPermissionRepository
.Modifier and Type | Method and Description |
---|---|
D |
createOnlyIfDoesNotExist(D permission,
Instant lastUpdated)
A specialized create operation for creating an entity with a pre-defined id with the minimum
guarantee that concurrent requests to this method for the same entity ID will fail.
|
D |
replaceOnlyIfLastUpdatedBefore(String entityId,
D permission,
Instant lastUpdated)
A specialized replace operation that does not invoke the "save" create-or-update behavior.
|
@Nullable D createOnlyIfDoesNotExist(D permission, Instant lastUpdated)
This is intended to be used in concurrent scenarios where only one operation should succeed.
Note that this method should create the record with the provided
UserPermission.archived
value, even if it is true
.
permission
- the permission to create. Must have a non-null id present.lastUpdated
- the UserPermission.lastUpdated
to set on the permissionnull
otherwise@Nullable D replaceOnlyIfLastUpdatedBefore(String entityId, D permission, Instant lastUpdated)
This is intended to be used in concurrent scenarios where only one operation should succeed.
Note that this update should succeed even if the existing record is
UserPermission.archived
.
Note that this method should also set the provided UserPermission.archived
value, even if it is true
.
entityId
- the id of the entity to replacepermission
- the replacement entitylastUpdated
- the timestamp of the current change. This will be compared to the
lastUpdated on the existing entity for determination of whether the replacement should
occur. Furthermore, the replacement will have its UserPermission.lastUpdated
set to this value.null
if the
entity was not found or could not be updated due to its lastUpdated value.Copyright © 2021. All rights reserved.