I'm trying to do:
String sql = "SELECT email FROM users WHERE (type like 'B') AND (username like '?1')";
List results = em.createNativeQuery(sql).setParameter(1, username).getResultList();
But I get IllegalArgumentException that tells me that the parameter is out of bounds. What am I doing wrong?