Skip to content

Don't log warnings on literal null parameters. #2277

Closed
@mdelmoral

Description

@mdelmoral

First of all, this is not a bug.

In the class Neo4jQuerySupport is the next line:

REPOSITORY_QUERY_LOG.warn("Do not use `null` as a property value for comparison."					
+ " It will always be false and return an empty result.");

This warning is triggered every time that the query has a null parameter. Even when these parameters are to set a null value in a property.
I have a @Query when $result can be null. This query is executed 200k/day so you can imagine my log file 😅
SET rel.teamId = $teamId, rel.result = $result

Today, I have two workarounds:

  • Configure the logs to exclude Neo4jQuerySupport warnings.
  • Create an alternative @Query with SET rel.teamId = $teamId in the cases the $result is null.

But I ask myself if this warning makes sense. When you're writing a query, it's assumed that you have to test it.

Thanks!

Metadata

Metadata

Labels

Type

No type

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions