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 Type
    Method
    Description
    default void
    executeSql(jakarta.persistence.EntityManager em, SqlRunnable work)
    Execute some SQL statements using the current JDBC connection.
    default Connection
    getConnection(jakarta.persistence.EntityManager em)
    Lookups the database connection in an entity manager.
    default void
    initialize(Properties properties)
    Initializes the properties for Hibernate and Fastnate.
    default void
    initialize(org.fastnate.generator.context.GeneratorContext context)
    Initializes the test setup.
  • Method Details

    • executeSql

      default void executeSql(jakarta.persistence.EntityManager em, SqlRunnable work) throws SQLException
      Execute some SQL statements using the current JDBC connection.
      Parameters:
      em - the current entity manager
      work - The work to be performed.
      Throws:
      SQLException - if there is a problem with the work
    • getConnection

      default Connection getConnection(jakarta.persistence.EntityManager em) throws SQLException
      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

      default void initialize(Properties properties)
      Initializes the properties for Hibernate and Fastnate.
      Parameters:
      properties - the properties