Class SpringJpaFactory
java.lang.Object
io.github.astrapi69.spring.orm.jpa.SpringJpaFactory
A factory class for creating jpa configuration objects.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic DataSourcenewDataSource(DataSourceBean dataSourceBean) Factory method for create the newDataSourceobject from the givenDataSourceBeanobject.static org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBeannewEntityManagerFactoryBean(String persistenceUnitName, DataSource dataSource, org.springframework.orm.jpa.JpaVendorAdapter vendorAdapter, 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(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(jakarta.persistence.EntityManagerFactory entityManagerFactory) Factory method for create the newJpaTransactionManagerobject from the givenEntityManagerFactoryobject.
-
Constructor Details
-
SpringJpaFactory
public SpringJpaFactory()
-
-
Method Details
-
newDataSource
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(String persistenceUnitName, DataSource dataSource, org.springframework.orm.jpa.JpaVendorAdapter vendorAdapter, 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
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(jakarta.persistence.EntityManagerFactory entityManagerFactory) Factory method for create the newJpaTransactionManagerobject from the givenEntityManagerFactoryobject.- Parameters:
entityManagerFactory-EntityManagerFactoryobject- Returns:
- the new
JpaTransactionManager
-