Class JpaTrackableRepositoryFactory
- java.lang.Object
-
- org.springframework.data.repository.core.support.RepositoryFactorySupport
-
- com.broadleafcommerce.data.tracking.jpa.filtering.narrow.factory.JpaTrackableRepositoryFactory
-
- All Implemented Interfaces:
org.springframework.beans.factory.Aware
,org.springframework.beans.factory.BeanClassLoaderAware
,org.springframework.beans.factory.BeanFactoryAware
public class JpaTrackableRepositoryFactory extends org.springframework.data.repository.core.support.RepositoryFactorySupport
Customized version ofJpaRepositoryFactory
to support a custom version ofPartTreeJpaQuery
. This facilitates a model where a special filtering step can be added for repository query method execution.- Author:
- Jeff Fischer
- See Also:
NarrowingPartTreeJpaQuery
,TrackableRepository
,Narrow
-
-
Field Summary
Fields Modifier and Type Field Description static boolean
RSQL_PRESENT
-
Constructor Summary
Constructors Constructor Description JpaTrackableRepositoryFactory(javax.persistence.EntityManager em, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, RSQLVisitorHolder<?> rsqlVisitorHolder, JpaFiltersCriteriaBuilder catalogFiltersCriteriaBuilder, JpaProperties properties, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description <T,ID>
org.springframework.data.jpa.repository.support.JpaEntityInformation<T,ID>getEntityInformation(Class<T> domainClass)
protected org.springframework.data.projection.ProjectionFactory
getProjectionFactory(ClassLoader classLoader, org.springframework.beans.factory.BeanFactory beanFactory)
protected Optional<org.springframework.data.repository.query.QueryLookupStrategy>
getQueryLookupStrategy(org.springframework.data.repository.query.QueryLookupStrategy.Key key, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider)
protected Class<?>
getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata metadata)
protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments
getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata)
protected Object
getTargetRepository(org.springframework.data.repository.core.RepositoryInformation information)
void
setBeanClassLoader(ClassLoader classLoader)
void
setEntityPathResolver(org.springframework.data.querydsl.EntityPathResolver entityPathResolver)
void
setEscapeCharacter(org.springframework.data.jpa.repository.query.EscapeCharacter escapeCharacter)
-
Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactorySupport
addQueryCreationListener, addRepositoryProxyPostProcessor, getQueryMethods, getRepository, getRepository, getRepository, getRepositoryInformation, getRepositoryMetadata, getTargetRepositoryViaReflection, getTargetRepositoryViaReflection, setBeanFactory, setEvaluationContextProvider, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, validate
-
-
-
-
Constructor Detail
-
JpaTrackableRepositoryFactory
public JpaTrackableRepositoryFactory(javax.persistence.EntityManager em, com.broadleafcommerce.data.tracking.core.TrackableBehaviorUtil behaviorUtil, @Nullable RSQLVisitorHolder<?> rsqlVisitorHolder, JpaFiltersCriteriaBuilder catalogFiltersCriteriaBuilder, JpaProperties properties, com.broadleafcommerce.common.jpa.RepositoryEntityTypeManager repositoryEntityTypeManager)
-
-
Method Detail
-
getQueryLookupStrategy
@NonNull protected Optional<org.springframework.data.repository.query.QueryLookupStrategy> getQueryLookupStrategy(@Nullable org.springframework.data.repository.query.QueryLookupStrategy.Key key, @NonNull org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider)
- Overrides:
getQueryLookupStrategy
in classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getRepositoryBaseClass
@NonNull protected Class<?> getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata metadata)
- Specified by:
getRepositoryBaseClass
in classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getRepositoryFragments
protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata)
- Overrides:
getRepositoryFragments
in classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getTargetRepository
@NonNull protected Object getTargetRepository(org.springframework.data.repository.core.RepositoryInformation information)
- Specified by:
getTargetRepository
in classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
setBeanClassLoader
public void setBeanClassLoader(ClassLoader classLoader)
- Specified by:
setBeanClassLoader
in interfaceorg.springframework.beans.factory.BeanClassLoaderAware
- Overrides:
setBeanClassLoader
in classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
setEntityPathResolver
public void setEntityPathResolver(org.springframework.data.querydsl.EntityPathResolver entityPathResolver)
-
setEscapeCharacter
public void setEscapeCharacter(org.springframework.data.jpa.repository.query.EscapeCharacter escapeCharacter)
-
getProjectionFactory
@NonNull protected org.springframework.data.projection.ProjectionFactory getProjectionFactory(@NonNull ClassLoader classLoader, @NonNull org.springframework.beans.factory.BeanFactory beanFactory)
- Overrides:
getProjectionFactory
in classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
getEntityInformation
@NonNull public <T,ID> org.springframework.data.jpa.repository.support.JpaEntityInformation<T,ID> getEntityInformation(@NonNull Class<T> domainClass)
- Specified by:
getEntityInformation
in classorg.springframework.data.repository.core.support.RepositoryFactorySupport
-
-