Interface BaseDaoConfig


  • public interface BaseDaoConfig
    This class declares the interface for @Bean methods related to data access and will be processed by the Spring container to generate bean definitions and service requests for those beans at runtime
    Since:
    1.0.0
    Author:
    Dharmesh Khandelwal
    • Method Summary

      All Methods Instance Methods Abstract Methods 
      Modifier and Type Method Description
      DataSource dataSource()
      A factory for connections to the physical data source that this DataSource object represents.
      org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean entityManagerFactory()
      FactoryBean that creates a JPA EntityManagerFactory according to JPA's standard container bootstrap contract.
      org.springframework.orm.jpa.JpaDialect jpaDialect()
      SPI strategy that encapsulates certain functionality that standard JPA 2.1 does not offer, such as access to the underlying JDBC Connection.
      Map<String,​Object> jpaProperties()
      Specify JPA properties as a Map, to be passed into Persistence.createEntityManagerFactory.
      org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter()
      SPI interface that allows to plug in vendor-specific behavior into Spring's EntityManagerFactory creators.
      org.springframework.transaction.PlatformTransactionManager transactionManager​(javax.persistence.EntityManagerFactory entityManagerFactory)
      This is the central interface in Spring's transaction infrastructure.
    • Method Detail

      • dataSource

        DataSource dataSource()
        A factory for connections to the physical data source that this DataSource object represents. An alternative to the DriverManager facility, a DataSource object is the preferred means of getting a connection. An object that implements the DataSource interface will typically be registered with a naming service based on the Java™ Naming and Directory (JNDI) API.
        Returns:
        The datasource bean
      • entityManagerFactory

        org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean entityManagerFactory()
        FactoryBean that creates a JPA EntityManagerFactory according to JPA's standard container bootstrap contract. This is the most powerful way to set up a shared JPA EntityManagerFactory in a Spring application context; the EntityManagerFactory can then be passed to JPA-based DAOs via dependency injection.
        Returns:
        The LocalContainerEntityManagerFactoryBean
      • jpaVendorAdapter

        org.springframework.orm.jpa.JpaVendorAdapter jpaVendorAdapter()
        SPI interface that allows to plug in vendor-specific behavior into Spring's EntityManagerFactory creators. Serves as single configuration point for all vendor-specific properties.
        Returns:
        The JpaVendorAdapter bean
      • jpaDialect

        org.springframework.orm.jpa.JpaDialect jpaDialect()
        SPI strategy that encapsulates certain functionality that standard JPA 2.1 does not offer, such as access to the underlying JDBC Connection. This strategy is mainly intended for standalone usage of a JPA provider; most of its functionality is not relevant when running with JTA transactions.
        Returns:
        The JpaDialect bean
      • transactionManager

        org.springframework.transaction.PlatformTransactionManager transactionManager​(javax.persistence.EntityManagerFactory entityManagerFactory)
        This is the central interface in Spring's transaction infrastructure. Applications can use this directly, but it is not primarily meant as API: Typically, applications will work with either TransactionTemplate or declarative transaction demarcation through AOP.
        Parameters:
        entityManagerFactory - The entityManagerFactory()
        Returns:
        The PlatformTransactionManager bean
      • jpaProperties

        Map<String,​Object> jpaProperties()
        Specify JPA properties as a Map, to be passed into Persistence.createEntityManagerFactory.
        Returns:
        The Map of JPA properties