Не работает
String sql = "UPDATE xsp_job_request SET xsp_job_status_id = 2 , xsp_job_id = :xspJobId WHERE xsp_job_request_id = :xspJobRequestId AND xsp_job_status_id = 1";
Query query = entityManager.createNativeQuery(sql);
query.setParameter("xspJobId", jobId);
query.setParameter("xspJobRequestId", jobRequestId);
affectedRows = query.executeUpdate();
Работает.Но нужно использовать запрос namedParameter
String sql = "UPDATE xsp_job_request SET xsp_job_status_id = 2 , xsp_job_id = '7884ed98-972a-46c8-ae22-e4f445b4568' WHERE xsp_job_request_id = '8fa2c5e46638ad66016638adab060000' AND xsp_job_status_id = 1";
Query query = entityManager.createNativeQuery(sql);
affectedRows = query.executeUpdate();