public class JpaRepositoryFactory
extends org.springframework.data.repository.core.support.RepositoryFactorySupport
Constructor and Description |
---|
JpaRepositoryFactory(javax.persistence.EntityManager entityManager)
Creates a new
JpaRepositoryFactory . |
Modifier and Type | Method and Description |
---|---|
<T,ID> JpaEntityInformation<T,ID> |
getEntityInformation(Class<T> domainClass) |
protected org.springframework.data.projection.ProjectionFactory |
getProjectionFactory(ClassLoader classLoader,
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 org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments |
getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata,
javax.persistence.EntityManager entityManager,
org.springframework.data.querydsl.EntityPathResolver resolver,
CrudMethodMetadata crudMethodMetadata)
Creates
RepositoryComposition.RepositoryFragments based on RepositoryMetadata to add JPA-specific extensions. |
protected JpaRepositoryImplementation<?,?> |
getTargetRepository(org.springframework.data.repository.core.RepositoryInformation information) |
protected JpaRepositoryImplementation<?,?> |
getTargetRepository(org.springframework.data.repository.core.RepositoryInformation information,
javax.persistence.EntityManager entityManager)
Callback to create a
JpaRepository instance with the given EntityManager |
void |
setBeanClassLoader(ClassLoader classLoader) |
void |
setEntityPathResolver(org.springframework.data.querydsl.EntityPathResolver entityPathResolver)
Configures the
EntityPathResolver to be used. |
void |
setEscapeCharacter(EscapeCharacter escapeCharacter)
Configures the escape character to be used for like-expressions created for derived queries.
|
void |
setQueryMethodFactory(JpaQueryMethodFactory queryMethodFactory)
Configures the
JpaQueryMethodFactory to be used. |
addInvocationListener, addQueryCreationListener, addRepositoryProxyPostProcessor, getProjectionFactory, getQueryMethods, getRepository, getRepository, getRepository, getRepositoryInformation, getRepositoryMetadata, getTargetRepositoryViaReflection, getTargetRepositoryViaReflection, instantiateClass, setBeanFactory, setEvaluationContextProvider, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, validate
public JpaRepositoryFactory(javax.persistence.EntityManager entityManager)
JpaRepositoryFactory
.entityManager
- must not be nullpublic void setBeanClassLoader(ClassLoader classLoader)
setBeanClassLoader
in interface BeanClassLoaderAware
setBeanClassLoader
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
public void setEntityPathResolver(org.springframework.data.querydsl.EntityPathResolver entityPathResolver)
EntityPathResolver
to be used. Defaults to SimpleEntityPathResolver.INSTANCE
.entityPathResolver
- must not be null.public void setEscapeCharacter(EscapeCharacter escapeCharacter)
escapeCharacter
- a character used for escaping in certain like expressions.public void setQueryMethodFactory(JpaQueryMethodFactory queryMethodFactory)
JpaQueryMethodFactory
to be used. Defaults to DefaultJpaQueryMethodFactory
.queryMethodFactory
- must not be null.protected final JpaRepositoryImplementation<?,?> getTargetRepository(org.springframework.data.repository.core.RepositoryInformation information)
getTargetRepository
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
protected JpaRepositoryImplementation<?,?> getTargetRepository(org.springframework.data.repository.core.RepositoryInformation information, javax.persistence.EntityManager entityManager)
JpaRepository
instance with the given EntityManager
information
- will never be null.entityManager
- will never be null.protected Class<?> getRepositoryBaseClass(org.springframework.data.repository.core.RepositoryMetadata metadata)
getRepositoryBaseClass
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
protected org.springframework.data.projection.ProjectionFactory getProjectionFactory(ClassLoader classLoader, BeanFactory beanFactory)
getProjectionFactory
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
protected Optional<org.springframework.data.repository.query.QueryLookupStrategy> getQueryLookupStrategy(@Nullable org.springframework.data.repository.query.QueryLookupStrategy.Key key, org.springframework.data.repository.query.QueryMethodEvaluationContextProvider evaluationContextProvider)
getQueryLookupStrategy
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
public <T,ID> JpaEntityInformation<T,ID> getEntityInformation(Class<T> domainClass)
getEntityInformation
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata)
getRepositoryFragments
in class org.springframework.data.repository.core.support.RepositoryFactorySupport
protected org.springframework.data.repository.core.support.RepositoryComposition.RepositoryFragments getRepositoryFragments(org.springframework.data.repository.core.RepositoryMetadata metadata, javax.persistence.EntityManager entityManager, org.springframework.data.querydsl.EntityPathResolver resolver, CrudMethodMetadata crudMethodMetadata)
RepositoryComposition.RepositoryFragments
based on RepositoryMetadata
to add JPA-specific extensions. Typically
adds a QuerydslJpaPredicateExecutor
if the repository interface uses Querydsl.
Can be overridden by subclasses to customize RepositoryComposition.RepositoryFragments
.
metadata
- repository metadata.entityManager
- the entity manager.resolver
- resolver to translate an plain domain class into a EntityPath
.crudMethodMetadata
- metadata about the invoked CRUD methods.Copyright © 2011–2023 Pivotal Software, Inc.. All rights reserved.