Skip to content

Commit

Permalink
HibernateDao constructor to allow passing sessionFactory explicitly
Browse files Browse the repository at this point in the history
  • Loading branch information
LandonBaer721 committed Jul 30, 2024
1 parent 1b5260c commit 35b4bdf
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/main/java/com/impactupgrade/nucleus/dao/HibernateDao.java
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,11 @@ public HibernateDao(Class<E> clazz) {
this.sessionFactory = HibernateUtil.getSessionFactory();
}

public HibernateDao(Class<E> clazz, SessionFactory sessionFactory) {
this.clazz = clazz;
this.sessionFactory = sessionFactory;
}

public E insert(E entity) {
final Session session = openSession();
Transaction transaction = session.beginTransaction();
Expand Down

0 comments on commit 35b4bdf

Please sign in to comment.