We recently switched to the latest Springboot version (well 2.4.0 since it already not the latest anymore) and tried to be ogm-free. Our app works fine but we've noticed a warning we didn't see before (I don't think it happened, but maybe we just didn't noticed?).
Anyway, here's the thing: one of our queries is in a repo and just returns a string after editing relationships. Pretty simple query. The thing is, the api route that executes this query takes a "user" param used to set the "modified_by" attribute in our graph.
Because of work with the UI team and the fact that this feature once didn't exist, this param isn't mandotory and thus, set to null when not provided. This was perfect since cypher treats
SET n.modified_by = $user
by not doing anything when the param is null. This actually works like a charm!
The only thing is we get a WARN each time it happens:
2021-01-04 10:48:30.382 WARN 11695 --- [nio-8080-exec-1] o.s.d.n.r.query.Neo4jQuerySupport : Do not use null
as a property value for comparison. It will always be false and return an empty result.
This happens whether the null param actually is used or not in the Cypher query: the WARN is issued when the @Query takes the null param in.
Of course, we could now just forbid the param being omitted since our UI has now caught up, but I was wondering if someone new how to avoid that? We also would rather avoid having 2 different (but almost identical) queries for each case( user filled // user not provided).
thanks in advance and a happy new year to everyone!