Whenever my primaryGrpId comes as null the following native query is failing with SQLGrammerException, because it is expecting NUMBER. Andy idea how to set NULL if parameter value is null with native query in JPA. The database is ORACLE.
@Modifying
@Query(nativeQuery = true, value = "update EVENT set PRIMARY_CATEGORY_ID=?2, PRIMARY_GROUPING_ID=?3 where PRIMARY_PERFORMER_ID=?1")
void updatePrimaryCatGrpOfEntities(Long primaryPerfId, Long primaryCatId, Long primaryGrpId);
Caused by: java.sql.SQLSyntaxErrorException: ORA-00932: inconsistent datatypes: expected NUMBER got BINARY
All my DAO methods are just declared, no implementation is provided to write something like "setParameter"....etc.