Code example for SessionFactory

Methods: getCurrentSession

0
	@Autowired 
	private SessionFactory sessionFactory;
 
	public void save(final PersistentScriptTemplate t)
	{ 
		sessionFactory.getCurrentSession().saveOrUpdate(t);
	} 
 
	@SuppressWarnings("unchecked") 
	public List<PersistentScriptTemplate> findAll(final Lang lang)
	{ 
		return sessionFactory.getCurrentSession()
			.createCriteria(PersistentScriptTemplate.class)
			.add(Restrictions.eq("lang", lang))
			.list(); 
	} 
 
	public PersistentScriptTemplate get(final Long id)
	{ 
		return (PersistentScriptTemplate)sessionFactory.getCurrentSession().get(