Class CoherenceRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>

java.lang.Object
org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
com.oracle.coherence.spring.data.support.CoherenceRepositoryFactoryBean<T,S,ID>
Type Parameters:
ID - the entity's identity type
T - the repository type
S - the entity type
All Implemented Interfaces:
Aware, BeanClassLoaderAware, BeanFactoryAware, FactoryBean<T>, InitializingBean, ApplicationEventPublisherAware, org.springframework.data.repository.core.support.RepositoryFactoryInformation<S,ID>

public class CoherenceRepositoryFactoryBean<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable> extends org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T,S,ID>
Factory responsible for creating Repository instances for a specific repository interface.
Since:
3.0
Author:
Ryan Lubke, Gunnar Hillert
  • Field Summary

    Fields inherited from interface org.springframework.beans.factory.FactoryBean

    OBJECT_TYPE_ATTRIBUTE
  • Constructor Summary

    Constructors
    Constructor
    Description
    CoherenceRepositoryFactoryBean(Class<? extends T> repositoryInterface)
    Constructs a new CoherenceRepositoryFactoryBean for the provided repository interface.
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    Ensure that coherence is not null.
    protected org.springframework.data.repository.core.support.RepositoryFactorySupport
    First checks for the presence of the CoherenceMap annotation to find the name of the Coherence NamedMap and Session.
    void
    setCoherence(com.tangosol.net.Coherence coherence)
    Configures the Coherence instance to be used.

    Methods inherited from class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport

    addRepositoryFactoryCustomizer, createDefaultQueryMethodEvaluationContextProvider, getEntityInformation, getObject, getObjectType, getPersistentEntity, getQueryMethods, getRepositoryInformation, isSingleton, setApplicationEventPublisher, setBeanClassLoader, setBeanFactory, setCustomImplementation, setEvaluationContextProvider, setLazyInit, setMappingContext, setNamedQueries, setQueryLookupStrategyKey, setRepositoryBaseClass, setRepositoryFragments

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • CoherenceRepositoryFactoryBean

      public CoherenceRepositoryFactoryBean(Class<? extends T> repositoryInterface)
      Constructs a new CoherenceRepositoryFactoryBean for the provided repository interface.
      Parameters:
      repositoryInterface - the repository interface
  • Method Details

    • createRepositoryFactory

      protected org.springframework.data.repository.core.support.RepositoryFactorySupport createRepositoryFactory()
      First checks for the presence of the CoherenceMap annotation to find the name of the Coherence NamedMap and Session. If the annotation is not present, then if the repository class name itself follows the format of [Entity-Type]Repository (e.g., BookRepository), then the NamedMap will be looked up using the lower-case name of the entity type. Using the BookRepository example, the NamedMap would be resolved to book.
      Specified by:
      createRepositoryFactory in class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>
      Returns:
      Throws:
      IllegalStateException - if the NamedMap name cannot be resolved
    • setCoherence

      public void setCoherence(com.tangosol.net.Coherence coherence)
      Configures the Coherence instance to be used.
      Parameters:
      coherence - the Coherence instance to set
    • afterPropertiesSet

      public void afterPropertiesSet()
      Ensure that coherence is not null.
      Specified by:
      afterPropertiesSet in interface InitializingBean
      Overrides:
      afterPropertiesSet in class org.springframework.data.repository.core.support.RepositoryFactoryBeanSupport<T extends org.springframework.data.repository.Repository<S,ID>,S,ID extends Serializable>
      See Also:
      • RepositoryFactoryBeanSupport.afterPropertiesSet()