public interface DomainMapperManager extends DomainMapper, PostMapper
DomainMapperMember
instances as a transformation pipeline between
domain types. Often used by CrudEntityService
implementations to convert between
repository domain class instances and their respective business domain instances (or vice versa).
DomainMapperManager may be used regardless of the backing repository plaform. It is agnostic to
the backing domain class type (or backing repository). If not using out-of-the-box ModelMapper
support, individual DomainMapperMember
instances may be employed to handle repository
specific mapping use cases.
An entity implementation will generally define a mapping approach between the repository domain
class and the business domain class. See ModelMapperMappable
, which should be implemented
by top level repository domain class implementations when using the out-of-the-box support
provided by ModelMapperDomainMapperMember
. Different DomainMapperMember
instances
may be used to achieve transformation via a different mapping approach.
Modifier and Type | Method and Description |
---|---|
default <P> P |
convertFromPersistentDomain(Object domain,
ContextInfo contextInfo)
Similar to
fromRepositoryDomain(Object, Class, ContextInfo) , but doesn't require the
caller to know the business domain type. |
default <D> D |
fromBusinessDomain(Object businessDomain,
Class<D> repositoryDomainType,
ContextInfo contextInfo)
Map and return a populated repository domain class instance, based on information provided in
a business domain instance.
|
<P> P |
fromRepositoryDomain(BusinessTypeAware repositoryDomain,
ContextInfo contextInfo)
Map and return a populated business domain instance, based on information provided in a
repository domain instance.
|
default <P> P |
fromRepositoryDomain(Object repositoryDomain,
Class<P> businessDomainType,
ContextInfo contextInfo)
Map and return a populated business domain instance, based on information provided in a
repository domain instance.
|
default <P> P |
fromRepositoryDomainByExample(Object repositoryDomain,
P example,
ContextInfo contextInfo)
Map and return a populated business domain instance, based on information provided in a
repository domain instance.
|
com.broadleafcommerce.common.extension.TypeFactory |
getTypeFactory() |
<P> List<P> |
process(List<?> repositoryDomain,
ContextInfo contextInfo)
Execute both the
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo) pipeline in a single
call. |
<P> P |
process(Object repositoryDomain,
ContextInfo contextInfo)
Execute both the
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(Object, Object, ContextInfo) pipeline in a
single call. |
<P> org.springframework.data.domain.Page<P> |
process(org.springframework.data.domain.Page<?> repositoryDomain,
ContextInfo contextInfo)
Execute both the
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo) pipeline in a single
call. |
<P> Stream<P> |
process(Stream<?> repositoryDomain,
ContextInfo contextInfo)
Execute both the
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo) pipeline in a single
call. |
deleteMap, getBusinessDomainType, modifyMap
transform, transform
@Nullable default <D> D fromBusinessDomain(Object businessDomain, Class<D> repositoryDomainType, @Nullable ContextInfo contextInfo)
DomainMapperMember.fromBusinessDomain(Object, Object, ContextInfo)
.D
- The repository domain typebusinessDomain
- The business instance containing the relevant property informationrepositoryDomainType
- The class defining the persisted domain type to returncontextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns. See TrackableRepository
for more info on
persistence behavior based on context.@Nullable default <P> P fromRepositoryDomain(Object repositoryDomain, Class<P> businessDomainType, @Nullable ContextInfo contextInfo)
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
.P
- The business domain typerepositoryDomain
- The persistence-based domain instance containing the relevant
property informationbusinessDomainType
- The class defining the business domain type to returncontextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns. See TrackableRepository
for more info on
persistence behavior based on context.@Nullable default <P> P fromRepositoryDomainByExample(Object repositoryDomain, P example, @Nullable ContextInfo contextInfo)
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
.P
- The business domain typerepositoryDomain
- The persistence-based domain instance containing the relevant
property informationexample
- The business domain instancecontextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns. See TrackableRepository
for more info on
persistence behavior based on context.<P> P fromRepositoryDomain(BusinessTypeAware repositoryDomain, ContextInfo contextInfo)
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
.P
- The business domain typerepositoryDomain
- The persistence-based domain instance containing the relevant
property information. This instance can produce the business domain type.contextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns. See TrackableRepository
for more info on
persistence behavior based on context.<P> P process(Object repositoryDomain, ContextInfo contextInfo)
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(Object, Object, ContextInfo)
pipeline in a
single call.P
- The projection typerepositoryDomain
- The originating repository domain instancecontextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns. See TrackableRepository
for more info on
persistence behavior based on context.<P> Stream<P> process(Stream<?> repositoryDomain, ContextInfo contextInfo)
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo)
pipeline in a single
call.P
- The projection typerepositoryDomain
- The originating repository domain instances in the form of a streamcontextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns. See TrackableRepository
for more info on
persistence behavior based on context.<P> List<P> process(List<?> repositoryDomain, ContextInfo contextInfo)
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo)
pipeline in a single
call.P
- The projection typerepositoryDomain
- The originating repository domain instances in the form of a listcontextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns. See TrackableRepository
for more info on
persistence behavior based on context.<P> org.springframework.data.domain.Page<P> process(org.springframework.data.domain.Page<?> repositoryDomain, ContextInfo contextInfo)
DomainMapperMember.fromRepositoryDomain(Object, Object, ContextInfo)
pipeline and PostMapper.transform(List, List, ContextInfo)
pipeline in a single
call.P
- The projection typerepositoryDomain
- The originating repository domain instances in the form of a page of
content.contextInfo
- The context information used to make tracking determinations relevant to
sandboxing and multitenant concerns. See TrackableRepository
for more info on
persistence behavior based on context.@Nullable default <P> P convertFromPersistentDomain(Object domain, @Nullable ContextInfo contextInfo)
fromRepositoryDomain(Object, Class, ContextInfo)
, but doesn't require the
caller to know the business domain type. In effect, this call combines the
DomainMapper.getBusinessDomainType(Object)
and
fromRepositoryDomain(Object, Class, ContextInfo)
into a single call.domain
- The repository domain instancecontextInfo
- Optional context information. Useful if the domain param is
Trackable
.com.broadleafcommerce.common.extension.TypeFactory getTypeFactory()
Copyright © 2021. All rights reserved.