Spring Data Commons

org.springframework.data.repository.config
Class RepositoryConfig<T extends SingleRepositoryConfigInformation<S>,S extends CommonRepositoryConfigInformation>

java.lang.Object
  extended by org.springframework.data.repository.config.RepositoryConfig<T,S>
All Implemented Interfaces:
CommonRepositoryConfigInformation, GlobalRepositoryConfigInformation<T>

public abstract class RepositoryConfig<T extends SingleRepositoryConfigInformation<S>,S extends CommonRepositoryConfigInformation>
extends Object
implements GlobalRepositoryConfigInformation<T>

Class defining access to the repository configuration abstracting the content of the repositories element in XML namespcae configuration. Defines default values to populate resulting repository beans with.

Author:
Oliver Gierke

Field Summary
static String BASE_PACKAGE
           
static String DEFAULT_REPOSITORY_IMPL_POSTFIX
           
static String QUERY_LOOKUP_STRATEGY
           
static String REPOSITORY_FACTORY_CLASS_NAME
           
static String REPOSITORY_IMPL_POSTFIX
           
static String TRANSACTION_MANAGER_REF
           
 
Constructor Summary
protected RepositoryConfig(Element repositoriesElement, String defaultRepositoryFactoryBeanClassName)
          Creates an instance of RepositoryConfig.
 
Method Summary
 boolean configureManually()
          Returns whether to consider manual configuration.
protected abstract  T createSingleRepositoryConfigInformationFor(Element element)
          Creates a SingleRepositoryConfigInformation for the given Element.
 String getBasePackage()
          Returns the base package.
 QueryLookupStrategy.Key getQueryLookupStrategyKey()
          Returns the strategy finder methods should be resolved.
 Class<?> getRepositoryBaseInterface()
          Returns the base interface to use
 String getRepositoryFactoryBeanClassName()
          Returns the configured repository factory class.
 String getRepositoryImplementationSuffix()
          Returns the suffix to use for implementation bean lookup or class detection.
 Iterable<T> getSingleRepositoryConfigInformations()
          Returns all SingleRepositoryConfigInformation instances used for manual configuration.
 Element getSource()
          Returns the element the repository information is derived from.
 String getTransactionManagerRef()
          Returns the bean name of the PlatformTransactionManager to be used.
 
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.GlobalRepositoryConfigInformation
getAutoconfigRepositoryInformation
 
Methods inherited from interface org.springframework.data.repository.config.CommonRepositoryConfigInformation
getNamedQueriesLocation
 

Field Detail

DEFAULT_REPOSITORY_IMPL_POSTFIX

public static final String DEFAULT_REPOSITORY_IMPL_POSTFIX
See Also:
Constant Field Values

QUERY_LOOKUP_STRATEGY

public static final String QUERY_LOOKUP_STRATEGY
See Also:
Constant Field Values

BASE_PACKAGE

public static final String BASE_PACKAGE
See Also:
Constant Field Values

REPOSITORY_IMPL_POSTFIX

public static final String REPOSITORY_IMPL_POSTFIX
See Also:
Constant Field Values

REPOSITORY_FACTORY_CLASS_NAME

public static final String REPOSITORY_FACTORY_CLASS_NAME
See Also:
Constant Field Values

TRANSACTION_MANAGER_REF

public static final String TRANSACTION_MANAGER_REF
See Also:
Constant Field Values
Constructor Detail

RepositoryConfig

protected RepositoryConfig(Element repositoriesElement,
                           String defaultRepositoryFactoryBeanClassName)
Creates an instance of RepositoryConfig.

Parameters:
repositoriesElement -
Method Detail

getSource

public Element getSource()
Description copied from interface: CommonRepositoryConfigInformation
Returns the element the repository information is derived from.

Specified by:
getSource in interface CommonRepositoryConfigInformation
Returns:

configureManually

public boolean configureManually()
Description copied from interface: GlobalRepositoryConfigInformation
Returns whether to consider manual configuration. If this returns true, clients should use GlobalRepositoryConfigInformation.getSingleRepositoryConfigInformations() to lookup configuration information for individual repository beans.

Specified by:
configureManually in interface GlobalRepositoryConfigInformation<T extends SingleRepositoryConfigInformation<S>>
Returns:

getQueryLookupStrategyKey

public QueryLookupStrategy.Key getQueryLookupStrategyKey()
Description copied from interface: CommonRepositoryConfigInformation
Returns the strategy finder methods should be resolved.

Specified by:
getQueryLookupStrategyKey in interface CommonRepositoryConfigInformation
Returns:

getBasePackage

public String getBasePackage()
Description copied from interface: CommonRepositoryConfigInformation
Returns the base package.

Specified by:
getBasePackage in interface CommonRepositoryConfigInformation
Returns:

getRepositoryFactoryBeanClassName

public String getRepositoryFactoryBeanClassName()
Description copied from interface: CommonRepositoryConfigInformation
Returns the configured repository factory class.

Specified by:
getRepositoryFactoryBeanClassName in interface CommonRepositoryConfigInformation
Returns:

getRepositoryImplementationSuffix

public String getRepositoryImplementationSuffix()
Description copied from interface: CommonRepositoryConfigInformation
Returns the suffix to use for implementation bean lookup or class detection.

Specified by:
getRepositoryImplementationSuffix in interface CommonRepositoryConfigInformation
Returns:

getTransactionManagerRef

public String getTransactionManagerRef()
Description copied from interface: CommonRepositoryConfigInformation
Returns the bean name of the PlatformTransactionManager to be used. Returns null if no reference has been configured explicitly.

Specified by:
getTransactionManagerRef in interface CommonRepositoryConfigInformation
Returns:

getSingleRepositoryConfigInformations

public Iterable<T> getSingleRepositoryConfigInformations()
Description copied from interface: GlobalRepositoryConfigInformation
Returns all SingleRepositoryConfigInformation instances used for manual configuration.

Specified by:
getSingleRepositoryConfigInformations in interface GlobalRepositoryConfigInformation<T extends SingleRepositoryConfigInformation<S>>
Returns:

getRepositoryBaseInterface

public Class<?> getRepositoryBaseInterface()
Description copied from interface: GlobalRepositoryConfigInformation
Returns the base interface to use

Specified by:
getRepositoryBaseInterface in interface GlobalRepositoryConfigInformation<T extends SingleRepositoryConfigInformation<S>>
Returns:

createSingleRepositoryConfigInformationFor

protected abstract T createSingleRepositoryConfigInformationFor(Element element)
Creates a SingleRepositoryConfigInformation for the given Element.

Parameters:
element -
Returns:

Spring Data Commons

Copyright © 2012. All Rights Reserved.