|
Spring Data Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.springframework.data.repository.config.RepositoryConfigurationExtensionSupport
public abstract class RepositoryConfigurationExtensionSupport
Base implementation of RepositoryConfigurationExtension
to ease the implementation of the interface. Will
default the default named query location based on a module prefix provided by implementors (see
getModulePrefix()
). Stubs out the post-processing methods as they might not be needed by default.
Field Summary | |
---|---|
protected static String |
REPOSITORY_INTERFACE_POST_PROCESSOR
|
Constructor Summary | |
---|---|
RepositoryConfigurationExtensionSupport()
|
Method Summary | ||
---|---|---|
String |
getDefaultNamedQueryLocation()
Returns the default location of the Spring Data named queries. |
|
protected abstract String |
getModulePrefix()
Returns the prefix of the module to be used to create the default location for Spring Data named queries. |
|
protected
|
getRepositoryConfiguration(String interfaceName,
T configSource)
Creates a actual RepositoryConfiguration instance for the given RepositoryConfigurationSource and
interface name. |
|
|
getRepositoryConfigurations(T configSource,
ResourceLoader loader)
Returns all RepositoryConfiguration s obtained through the given RepositoryConfigurationSource . |
|
static boolean |
hasBean(Class<?> type,
BeanDefinitionRegistry registry)
Returns whether the given BeanDefinitionRegistry already contains a bean of the given type assuming the
bean name has been autogenerated. |
|
void |
postProcess(BeanDefinitionBuilder builder,
AnnotationRepositoryConfigurationSource config)
Callback to post process the BeanDefinition built from annotations and tweak the configuration if
necessary. |
|
void |
postProcess(BeanDefinitionBuilder builder,
XmlRepositoryConfigurationSource config)
Callback to post process the BeanDefinition built from XML and tweak the configuration if necessary. |
|
void |
registerBeansForRoot(BeanDefinitionRegistry registry,
RepositoryConfigurationSource configurationSource)
Callback to register additional bean definitions for a repositories root node. |
|
static String |
registerWithSourceAndGeneratedBeanName(BeanDefinitionRegistry registry,
AbstractBeanDefinition bean,
Object source)
Sets the given source on the given AbstractBeanDefinition and registers it inside the given
BeanDefinitionRegistry . |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface org.springframework.data.repository.config.RepositoryConfigurationExtension |
---|
getRepositoryFactoryClassName |
Field Detail |
---|
protected static final String REPOSITORY_INTERFACE_POST_PROCESSOR
Constructor Detail |
---|
public RepositoryConfigurationExtensionSupport()
Method Detail |
---|
public <T extends RepositoryConfigurationSource> Collection<RepositoryConfiguration<T>> getRepositoryConfigurations(T configSource, ResourceLoader loader)
RepositoryConfigurationExtension
RepositoryConfiguration
s obtained through the given RepositoryConfigurationSource
.
getRepositoryConfigurations
in interface RepositoryConfigurationExtension
configSource
- must not be null.loader
- must not be null.
public String getDefaultNamedQueryLocation()
RepositoryConfigurationExtension
getDefaultNamedQueryLocation
in interface RepositoryConfigurationExtension
public void registerBeansForRoot(BeanDefinitionRegistry registry, RepositoryConfigurationSource configurationSource)
RepositoryConfigurationExtension
registerBeansForRoot
in interface RepositoryConfigurationExtension
protected abstract String getModulePrefix()
public void postProcess(BeanDefinitionBuilder builder, AnnotationRepositoryConfigurationSource config)
RepositoryConfigurationExtension
BeanDefinition
built from annotations and tweak the configuration if
necessary.
postProcess
in interface RepositoryConfigurationExtension
builder
- will never be null.config
- will never be null.public void postProcess(BeanDefinitionBuilder builder, XmlRepositoryConfigurationSource config)
RepositoryConfigurationExtension
BeanDefinition
built from XML and tweak the configuration if necessary.
postProcess
in interface RepositoryConfigurationExtension
builder
- will never be null.config
- will never be null.public static String registerWithSourceAndGeneratedBeanName(BeanDefinitionRegistry registry, AbstractBeanDefinition bean, Object source)
AbstractBeanDefinition
and registers it inside the given
BeanDefinitionRegistry
.
registry
- bean
- source
-
public static boolean hasBean(Class<?> type, BeanDefinitionRegistry registry)
BeanDefinitionRegistry
already contains a bean of the given type assuming the
bean name has been autogenerated.
type
- registry
-
protected <T extends RepositoryConfigurationSource> RepositoryConfiguration<T> getRepositoryConfiguration(String interfaceName, T configSource)
RepositoryConfiguration
instance for the given RepositoryConfigurationSource
and
interface name. Defaults to the DefaultRepositoryConfiguration
but allows sub-classes to override this to
customize the behaviour.
interfaceName
- will never be null or empty.configSource
- will never be null.
|
Spring Data Core | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |