Class BibernateSessionFactory
java.lang.Object
io.github.blyznytsiaorg.bibernate.BibernateEntityManagerFactory
io.github.blyznytsiaorg.bibernate.session.BibernateSessionFactory
- All Implemented Interfaces:
EntityManagerFactory
,Closeable
,AutoCloseable
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 Summary
-
Constructor Summary
ConstructorDescriptionBibernateSessionFactory
(BibernateDatabaseSettings bibernateDatabaseSettings, SimpleRepositoryInvocationHandler simpleRepositoryInvocationHandler) Constructs a new BibernateSessionFactory with the provided database settings and repository invocation handler. -
Method Summary
Modifier and TypeMethodDescriptionprivate EntityDao
Creates a new EntityDao instance based on the configured database settings.Retrieves the list of executed queries during the session, if available.Opens a new session for interacting with the database.Methods inherited from class io.github.blyznytsiaorg.bibernate.BibernateEntityManagerFactory
close, getBibernateSessionFactory
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface io.github.blyznytsiaorg.bibernate.EntityManagerFactory
getSimpleRepositoryInvocationHandler
-
Field Details
-
entityDao
-
-
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 factorysimpleRepositoryInvocationHandler
- the repository invocation handler for handling repository methods
-
-
Method Details
-
openSession
Opens a new session for interacting with the database.- Returns:
- a new BibernateSession instance
-
entityDao
Creates a new EntityDao instance based on the configured database settings.- Returns:
- a new EntityDao instance
-
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
-