Q:

how to pass two named parameters in hibernate?

I am doing something like this but it doesn't work
@Override
public void delete(String email, String answer) {
    String hql = "delete from tourism_answers_table where email = :email and answer = :answer ";
    getSession().createQuery(hql)
                .setParameter("email", email)
                .setParameter("answer", answer)
                .executeUpdate();

}

A:

Here is your solution, just Creating a Query Instance
@Override
public void delete(String email, String answer) {
     Query query = getCurrentSession().createQuery("delete from tourism_answers_table where email =:email and answer =:answer );
        query.setString("email", email);
        query.setString("answer", answer);
        query.executeUpdate();
}

