Class SpringJpaFactory

java.lang.Object
io.github.astrapi69.spring.orm.jpa.SpringJpaFactory

public class SpringJpaFactory extends Object
A factory class for creating jpa configuration objects.
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    static DataSource
    newDataSource(DataSourceBean dataSourceBean)
    Factory method for create the new DataSource object from the given DataSourceBean object.
    static org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean
    newEntityManagerFactoryBean(String persistenceUnitName, DataSource dataSource, org.springframework.orm.jpa.JpaVendorAdapter vendorAdapter, 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
    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(jakarta.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 Details

    • SpringJpaFactory

      public SpringJpaFactory()
  • Method Details

    • newDataSource

      public static 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(String persistenceUnitName, DataSource dataSource, org.springframework.orm.jpa.JpaVendorAdapter vendorAdapter, 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(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(jakarta.persistence.EntityManagerFactory entityManagerFactory)
      Factory method for create the new JpaTransactionManager object from the given EntityManagerFactory object.
      Parameters:
      entityManagerFactory - EntityManagerFactory object
      Returns:
      the new JpaTransactionManager