After investigating it, it looks the isOrdinalParameterZeroBased is used in the query plan cache key. Removing it is not a good idea since the isOrdinalParameterZeroBased is different if we call either createSQLQuery or createNativeQuery.