Package org.fastnate.generator.test
Interface JpaProviderTestSetup
public interface JpaProviderTestSetup
Provides methods for accessing functions specific for the current JPA implementation during the tests.
- Author:
- Tobias Liefke
-
Method Summary
Modifier and TypeMethodDescriptiondefault voidexecuteSql(jakarta.persistence.EntityManager em, SqlRunnable work) Execute some SQL statements using the currentJDBC connection.default ConnectiongetConnection(jakarta.persistence.EntityManager em) Lookups the database connection in an entity manager.default voidinitialize(Properties properties) Initializes the properties for Hibernate and Fastnate.default voidinitialize(org.fastnate.generator.context.GeneratorContext context) Initializes the test setup.
-
Method Details
-
executeSql
Execute some SQL statements using the currentJDBC connection.- Parameters:
em- the current entity managerwork- The work to be performed.- Throws:
SQLException- if there is a problem with the work
-
getConnection
Lookups the database connection in an entity manager.- Parameters:
em- the current entity manager- Returns:
- the database connection
- Throws:
SQLException- if the database connection is not available
-
initialize
default void initialize(org.fastnate.generator.context.GeneratorContext context) Initializes the test setup.- Parameters:
context- the current generator context
-
initialize
Initializes the properties for Hibernate and Fastnate.- Parameters:
properties- the properties
-