Did you read the exception message? Remember that ordinal parameters are 1-based! Position: 1
And did you try using?
Query query = sessionFactory.getCurrentSession().createQuery("from Customer where name = ?1"); query.setParameter(1, "Smith");