Class BibernateSessionFactory

java.lang.Object
io.github.blyznytsiaorg.bibernate.BibernateEntityManagerFactory
io.github.blyznytsiaorg.bibernate.session.BibernateSessionFactory
All Implemented Interfaces:
EntityManagerFactory, Closeable, AutoCloseable

public class BibernateSessionFactory extends BibernateEntityManagerFactory
Represents a session factory in the Bibernate framework, responsible for creating sessions to interact with the database. Extends BibernateEntityManagerFactory to inherit configuration settings.
Since:
1.0
Author:
Blyzhnytsia Team
  • Field Details

  • Constructor Details

    • BibernateSessionFactory

      public BibernateSessionFactory(BibernateDatabaseSettings bibernateDatabaseSettings, SimpleRepositoryInvocationHandler simpleRepositoryInvocationHandler)
      Constructs a new BibernateSessionFactory with the provided database settings and repository invocation handler.
      Parameters:
      bibernateDatabaseSettings - the database settings for configuring the session factory
      simpleRepositoryInvocationHandler - the repository invocation handler for handling repository methods
  • Method Details

    • openSession

      public BibernateSession openSession()
      Opens a new session for interacting with the database.
      Returns:
      a new BibernateSession instance
    • entityDao

      private EntityDao entityDao()
      Creates a new EntityDao instance based on the configured database settings.
      Returns:
      a new EntityDao instance
    • getExecutedQueries

      public List<String> getExecutedQueries()
      Retrieves the list of executed queries during the session, if available.
      Returns:
      the list of executed queries, or an empty list if no queries were executed