Code example for SessionFactory

Methods: getCurrentSession

0
		this.sessionFactory = sessionFactory;
	} 
 
	@Override 
	public Person save(Person person) {
		this.sessionFactory.getCurrentSession().save(person);
		return person;
	} 
 
	@Override 
	public Person findByName(String name) {
		return (Person) this.sessionFactory.getCurrentSession().createQuery(
			"from Person person where person.name = :name").setString("name", name).uniqueResult();
	} 
} 
Experience pair programming with AI  Get Codota for Java