For an more extensive description and reproducer, check the attached ZIP file. Bottom-line: we create a named native query programmatically, with a named parameter and register that with the EMF. Then upon execution, we create a native query referencing the registered query, and call setParameter using the parameter name. This throws a NPE. However, passing a positional parameter in setParameter succeeds (even though the registered query does not use positional parameters). |