Class SpringJpaFactory


  • public class SpringJpaFactory
    extends java.lang.Object
    A factory class for creating jpa configuration objects.
    • Method Summary

      All Methods Static Methods Concrete Methods 
      Modifier and Type Method Description
      static javax.sql.DataSource newDataSource​(DataSourceBean dataSourceBean)
      Factory method for create the new DataSource object from the given DataSourceBean object.
      static org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean newEntityManagerFactoryBean​(java.lang.String persistenceUnitName, javax.sql.DataSource dataSource, org.springframework.orm.jpa.JpaVendorAdapter vendorAdapter, java.util.Properties jpaProperties)
      Factory method for create the new LocalContainerEntityManagerFactoryBean object from the given persistence unit name as String object, the DataSource object, the JpaVendorAdapter object and the jpa Properties.
      static org.springframework.jdbc.core.JdbcTemplate newJdbcTemplate​(javax.sql.DataSource dataSource)
      Factory method for create the new JdbcTemplate object from the given DataSource object.
      static org.springframework.orm.jpa.JpaVendorAdapter newJpaVendorAdapter​(org.springframework.orm.jpa.vendor.Database db)
      Factory method for create the new JpaVendorAdapter object from the given Database object.
      static org.springframework.orm.jpa.JpaTransactionManager newTransactionManager​(javax.persistence.EntityManagerFactory entityManagerFactory)
      Factory method for create the new JpaTransactionManager object from the given EntityManagerFactory object.
      • Methods inherited from class java.lang.Object

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

      • SpringJpaFactory

        public SpringJpaFactory()
    • Method Detail

      • newDataSource

        public static javax.sql.DataSource newDataSource​(DataSourceBean dataSourceBean)
        Factory method for create the new DataSource object from the given DataSourceBean object.
        Parameters:
        dataSourceBean - the DataSourceBean object
        Returns:
        the new DataSource
      • newEntityManagerFactoryBean

        public static org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean newEntityManagerFactoryBean​(java.lang.String persistenceUnitName,
                                                                                                                     javax.sql.DataSource dataSource,
                                                                                                                     org.springframework.orm.jpa.JpaVendorAdapter vendorAdapter,
                                                                                                                     java.util.Properties jpaProperties)
        Factory method for create the new LocalContainerEntityManagerFactoryBean object from the given persistence unit name as String object, the DataSource object, the JpaVendorAdapter object and the jpa Properties.
        Parameters:
        persistenceUnitName - the persistence unit name
        dataSource - the data source
        vendorAdapter - the vendor adapter
        jpaProperties - the jpa properties
        Returns:
        the new LocalContainerEntityManagerFactoryBean object
      • newJdbcTemplate

        public static org.springframework.jdbc.core.JdbcTemplate newJdbcTemplate​(javax.sql.DataSource dataSource)
        Factory method for create the new JdbcTemplate object from the given DataSource object.
        Parameters:
        dataSource - the DataSource object
        Returns:
        the new JdbcTemplate
      • newJpaVendorAdapter

        public static org.springframework.orm.jpa.JpaVendorAdapter newJpaVendorAdapter​(org.springframework.orm.jpa.vendor.Database db)
        Factory method for create the new JpaVendorAdapter object from the given Database object.
        Parameters:
        db - the Database object
        Returns:
        the new JpaVendorAdapter
      • newTransactionManager

        public static org.springframework.orm.jpa.JpaTransactionManager newTransactionManager​(javax.persistence.EntityManagerFactory entityManagerFactory)
        Factory method for create the new JpaTransactionManager object from the given EntityManagerFactory object.
        Parameters:
        entityManagerFactory - EntityManagerFactory object
        Returns:
        the new JpaTransactionManager