Class JpaCustomizedSandboxRepository<D extends JpaSandbox>
java.lang.Object
com.broadleafcommerce.sandbox.provider.jpa.repository.trackable.JpaCustomizedSandboxRepository<D>
- All Implemented Interfaces:
CustomizedSandboxRepository<D>
public class JpaCustomizedSandboxRepository<D extends JpaSandbox>
extends Object
implements CustomizedSandboxRepository<D>
- Author:
- Jeff Fischer
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptioncleanupBatch
(String startingId, Object source) Check a bag of Sandbox entities for completion state.createIfDoesNotExist
(D sandbox, com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Performs an atomic upsert, only creating the given sandbox if not already present.void
setEventPublisher
(org.springframework.context.ApplicationEventPublisher eventPublisher) void
setJdbcTemplate
(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) void
setProperties
(CompletionCleanupProperties properties) void
setRepository
(SandboxRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository) void
setSandboxService
(SandboxService<Sandbox> sandboxService)
-
Constructor Details
-
JpaCustomizedSandboxRepository
public JpaCustomizedSandboxRepository()
-
-
Method Details
-
setRepository
@Autowired @Lazy public void setRepository(SandboxRepository<com.broadleafcommerce.data.tracking.core.Trackable> repository) -
createIfDoesNotExist
@Nullable public D createIfDoesNotExist(@NonNull D sandbox, @Nullable com.broadleafcommerce.data.tracking.core.context.ContextInfo contextInfo) Description copied from interface:CustomizedSandboxRepository
Performs an atomic upsert, only creating the given sandbox if not already present.This differs from the normal save/create in that whether or not a new entity should be created is based on the
Sandbox.getId()
contextId} rather than the data-store ID.- Specified by:
createIfDoesNotExist
in interfaceCustomizedSandboxRepository<D extends JpaSandbox>
- Parameters:
sandbox
- the sandbox to createcontextInfo
- context surrounding multitenant sate- Returns:
- the sandbox if it was newly created,
null
otherwise
-
cleanupBatch
Description copied from interface:CustomizedSandboxRepository
Check a bag of Sandbox entities for completion state. If complete, archive. Only applies to temporary sandboxes. SeeSandbox.isTemporarySandbox()
.- Specified by:
cleanupBatch
in interfaceCustomizedSandboxRepository<D extends JpaSandbox>
- Parameters:
startingId
- The Sandbox entity id that represents the start of the collection of entities to check. The size of the collection is determined byCompletionCleanupProperties.getCleanupBatchSize()
.source
- The specific cleanup service instance making the call- Returns:
- The last Sandbox entity id used as part of the executed batch. This value is
interesting to provide as the
startingId
for subsequent calls to this method when performing a paged style execution approach. May be null if no values were found, or if fewer than the configured batch size were found.
-
setJdbcTemplate
@Autowired @Qualifier("summaryCompletionJdbcTemplate") public void setJdbcTemplate(org.springframework.jdbc.core.JdbcTemplate jdbcTemplate) -
setProperties
-
setSandboxService
-
setEventPublisher
@Autowired public void setEventPublisher(@Nullable org.springframework.context.ApplicationEventPublisher eventPublisher)
-