diff --git a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/queryparams/JPAQueryParamsUnitTest.java b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/queryparams/JPAQueryParamsUnitTest.java index fcac6415c9..97f82f7914 100644 --- a/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/queryparams/JPAQueryParamsUnitTest.java +++ b/persistence-modules/java-jpa/src/test/java/com/baeldung/jpa/queryparams/JPAQueryParamsUnitTest.java @@ -37,7 +37,7 @@ public class JPAQueryParamsUnitTest { TypedQuery query = entityManager.createQuery( "SELECT e FROM Employee e WHERE e.empNumber = ?1" , Employee.class); String empNumber = "A123"; - Employee employee = query.setParameter(0, empNumber).getSingleResult(); + Employee employee = query.setParameter(1, empNumber).getSingleResult(); Assert.assertNotNull("Employee not found", employee); }