We use EcipseLink with the basic JPA methods, but I'm trying to solve a problem regarding large resultsets so I'm looking into trying DataReadQuery and a streaming result set. That's my end goal but I can't get a basic query to run. Documentation seems pretty sparse online so I'm mostly winging it.
Session session = manager.unwrap(Session.class);
DataReadQuery query = new DataReadQuery("select first_name from user_table where user_id = ?");
List<String> arguments = new ArrayList<>();
arguments.add("Bob");
session.executeQuery(query, arguments);
This is a native query, not JPQL if that is important.
It throws The number of arguments provided to the query for execution does not match the number of arguments in the query definition. There's only 1 argument. It seems I'm clearly not passing in the value correctly.
Two potential problems with what you are doing.
See https://docs.oracle.com/cd/E15523_01/web.1111/b32441/qrybas.htm#CIHEBFID for examples