Class SpringJpaFactory
- java.lang.Object
-
- io.github.astrapi69.spring.orm.jpa.SpringJpaFactory
-
public class SpringJpaFactory extends java.lang.Object
A factory class for creating jpa configuration objects.
-
-
Constructor Summary
Constructors Constructor Description SpringJpaFactory()
-
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 newDataSource
object from the givenDataSourceBean
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 newLocalContainerEntityManagerFactoryBean
object from the given persistence unit name asString
object, theDataSource
object, theJpaVendorAdapter
object and the jpaProperties
.static org.springframework.jdbc.core.JdbcTemplate
newJdbcTemplate(javax.sql.DataSource dataSource)
Factory method for create the newJdbcTemplate
object from the givenDataSource
object.static org.springframework.orm.jpa.JpaVendorAdapter
newJpaVendorAdapter(org.springframework.orm.jpa.vendor.Database db)
Factory method for create the newJpaVendorAdapter
object from the givenDatabase
object.static org.springframework.orm.jpa.JpaTransactionManager
newTransactionManager(javax.persistence.EntityManagerFactory entityManagerFactory)
Factory method for create the newJpaTransactionManager
object from the givenEntityManagerFactory
object.
-
-
-
Method Detail
-
newDataSource
public static javax.sql.DataSource newDataSource(DataSourceBean dataSourceBean)
Factory method for create the newDataSource
object from the givenDataSourceBean
object.- Parameters:
dataSourceBean
- theDataSourceBean
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 newLocalContainerEntityManagerFactoryBean
object from the given persistence unit name asString
object, theDataSource
object, theJpaVendorAdapter
object and the jpaProperties
.- Parameters:
persistenceUnitName
- the persistence unit namedataSource
- the data sourcevendorAdapter
- the vendor adapterjpaProperties
- 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 newJdbcTemplate
object from the givenDataSource
object.- Parameters:
dataSource
- theDataSource
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 newJpaVendorAdapter
object from the givenDatabase
object.- Parameters:
db
- theDatabase
object- Returns:
- the new
JpaVendorAdapter
-
newTransactionManager
public static org.springframework.orm.jpa.JpaTransactionManager newTransactionManager(javax.persistence.EntityManagerFactory entityManagerFactory)
Factory method for create the newJpaTransactionManager
object from the givenEntityManagerFactory
object.- Parameters:
entityManagerFactory
-EntityManagerFactory
object- Returns:
- the new
JpaTransactionManager
-
-