Class BaseRsqlMappableCrudEntityService<P>
java.lang.Object
com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService<P>
com.broadleafcommerce.data.tracking.core.service.BaseRsqlMappableCrudEntityService<P>
- Type Parameters:
P- The business domain type
- All Implemented Interfaces:
MappableCrudEntityService<P>,RsqlMappableCrudEntityService<P>
public class BaseRsqlMappableCrudEntityService<P>
extends BaseMappableCrudEntityService<P>
implements RsqlMappableCrudEntityService<P>
Real-world service implementations of
RsqlMappableCrudEntityService can extend from this
class as a convenience to inherit CRUD behavior for a particular business domain type. By
default, this class in turn defers to RsqlMappableCrudEntityHelper in order to allow
easier refactoring of core functionality.
If a service implementation spans several repository types, then it is recommended to inject the
RsqlMappableCrudEntityHelper rather than extend this class.
- Author:
- Jeff Fischer
-
Constructor Summary
ConstructorsConstructorDescriptionBaseRsqlMappableCrudEntityService(R repository, RsqlMappableCrudEntityHelper helper) -
Method Summary
Modifier and TypeMethodDescriptionprotected RsqlMappableCrudEntityHelperreadAll(cz.jirutka.rsql.parser.ast.Node filters) Retrieve all domain instances using a structured query string to drive the query criteria.org.springframework.data.domain.Page<P>readAll(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Pageable pageable) Retrieve all domain instances using a structured query string to drive the query criteria.readAll(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Sort sort) Retrieve all domain instances using a structured query string to drive the query criteria.org.springframework.data.domain.Page<P>readAll(cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Sort sort, org.springframework.data.domain.Pageable pageable) Retrieve all domain instances using a structured query string to drive the query criteria.Methods inherited from class com.broadleafcommerce.data.tracking.core.service.BaseMappableCrudEntityService
convertFromPersistentDomain, create, createAll, createAllAllowingPartialSuccess, delete, getHelper, getRepository, readAll, readAll, readAll, readAllByIds, readById, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccessMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.broadleafcommerce.data.tracking.core.service.MappableCrudEntityService
create, createAll, createAllAllowingPartialSuccess, delete, readAll, readAll, readAll, readAllByIds, readById, replace, replaceAll, replaceAllAllowingPartialSuccess, update, updateAll, updateAllAllowingPartialSuccess
-
Constructor Details
-
BaseRsqlMappableCrudEntityService
-
-
Method Details
-
readAll
public List<P> readAll(@NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Sort sort) Description copied from interface:RsqlMappableCrudEntityServiceRetrieve all domain instances using a structured query string to drive the query criteria. The filters string is parsed by an internal implementation and the result is added to the query before executing the fetch against the persistence store. SeeFilterParserfor more information.This version also accepts a formatted sort string that declares the sorting characteristics for the query.
- Specified by:
readAllin interfaceRsqlMappableCrudEntityService<P>- Parameters:
filters- the RSQLNodeused to restrict result, must not be nullsort- The string containing the structured list of sorts to apply- Returns:
- The list of narrowed, sorted entities
-
readAll
Description copied from interface:RsqlMappableCrudEntityServiceRetrieve all domain instances using a structured query string to drive the query criteria. The filters string is parsed by an internal implementation and the result is added to the query before executing the fetch against the persistence store. SeeFilterParserfor more information.- Specified by:
readAllin interfaceRsqlMappableCrudEntityService<P>- Parameters:
filters- the RSQLNodeused to restrict result, must not be null- Returns:
- The list of narrowed, sorted entities
-
readAll
public org.springframework.data.domain.Page<P> readAll(@NonNull cz.jirutka.rsql.parser.ast.Node filters, org.springframework.data.domain.Sort sort, @NonNull org.springframework.data.domain.Pageable pageable) Description copied from interface:RsqlMappableCrudEntityServiceRetrieve all domain instances using a structured query string to drive the query criteria. The filters string is parsed by an internal implementation and the result is added to the query before executing the fetch against the persistence store. SeeFilterParserfor more information.This version also accepts a Sort to apply to the result set
- Specified by:
readAllin interfaceRsqlMappableCrudEntityService<P>- Parameters:
filters- the RSQLNodeused to restrict result, must not be nullsort- sort to apply to the querypageable- may bePageable.unpaged(), must not be null.- Returns:
- The subset (page) of narrowed entities
-
readAll
public org.springframework.data.domain.Page<P> readAll(@NonNull cz.jirutka.rsql.parser.ast.Node filters, @NonNull org.springframework.data.domain.Pageable pageable) Description copied from interface:RsqlMappableCrudEntityServiceRetrieve all domain instances using a structured query string to drive the query criteria. The filters string is parsed by an internal implementation and the result is added to the query before executing the fetch against the persistence store. SeeFilterParserfor more information.- Specified by:
readAllin interfaceRsqlMappableCrudEntityService<P>- Parameters:
filters- the RSQLNodeused to restrict result, must not be nullpageable- may bePageable.unpaged(), must not be null.- Returns:
- The subset (page) of narrowed entities
-
getRsqlHelper
-