public User getUser(String username) {
		Query query = sessionFactory.getCurrentSession().createQuery("from User where username = :username");
		query.setParameter("username", username);
		List<?> list = query.list();
		if (list.size() == 0)
			return null;
		return (User) list.get(0);
	}