Class SpringJpaFactory
- java.lang.Object
-
- io.github.astrapi69.spring.orm.jpa.SpringJpaFactory
-
public class SpringJpaFactory extends java.lang.ObjectA 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.DataSourcenewDataSource(DataSourceBean dataSourceBean)Factory method for create the newDataSourceobject from the givenDataSourceBeanobject.static org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBeannewEntityManagerFactoryBean(java.lang.String persistenceUnitName, javax.sql.DataSource dataSource, org.springframework.orm.jpa.JpaVendorAdapter vendorAdapter, java.util.Properties jpaProperties)Factory method for create the newLocalContainerEntityManagerFactoryBeanobject from the given persistence unit name asStringobject, theDataSourceobject, theJpaVendorAdapterobject and the jpaProperties.static org.springframework.jdbc.core.JdbcTemplatenewJdbcTemplate(javax.sql.DataSource dataSource)Factory method for create the newJdbcTemplateobject from the givenDataSourceobject.static org.springframework.orm.jpa.JpaVendorAdapternewJpaVendorAdapter(org.springframework.orm.jpa.vendor.Database db)Factory method for create the newJpaVendorAdapterobject from the givenDatabaseobject.static org.springframework.orm.jpa.JpaTransactionManagernewTransactionManager(javax.persistence.EntityManagerFactory entityManagerFactory)Factory method for create the newJpaTransactionManagerobject from the givenEntityManagerFactoryobject.
-
-
-
Method Detail
-
newDataSource
public static javax.sql.DataSource newDataSource(DataSourceBean dataSourceBean)
Factory method for create the newDataSourceobject from the givenDataSourceBeanobject.- Parameters:
dataSourceBean- theDataSourceBeanobject- 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 newLocalContainerEntityManagerFactoryBeanobject from the given persistence unit name asStringobject, theDataSourceobject, theJpaVendorAdapterobject and the jpaProperties.- Parameters:
persistenceUnitName- the persistence unit namedataSource- the data sourcevendorAdapter- the vendor adapterjpaProperties- the jpa properties- Returns:
- the new
LocalContainerEntityManagerFactoryBeanobject
-
newJdbcTemplate
public static org.springframework.jdbc.core.JdbcTemplate newJdbcTemplate(javax.sql.DataSource dataSource)
Factory method for create the newJdbcTemplateobject from the givenDataSourceobject.- Parameters:
dataSource- theDataSourceobject- 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 newJpaVendorAdapterobject from the givenDatabaseobject.- Parameters:
db- theDatabaseobject- Returns:
- the new
JpaVendorAdapter
-
newTransactionManager
public static org.springframework.orm.jpa.JpaTransactionManager newTransactionManager(javax.persistence.EntityManagerFactory entityManagerFactory)
Factory method for create the newJpaTransactionManagerobject from the givenEntityManagerFactoryobject.- Parameters:
entityManagerFactory-EntityManagerFactoryobject- Returns:
- the new
JpaTransactionManager
-
-