From 50dffbe8e06d32f66b7e6f3d26c254931e5f4ab9 Mon Sep 17 00:00:00 2001 From: Matthew Moss Date: Wed, 8 Dec 2021 08:44:54 -0600 Subject: [PATCH] Use isNull rather than eq when checking for null. Query.eq with a null value does not do as expected; use the more specific Query.isNull restriction. --- src/main/groovy/gorm/logical/delete/PreQueryListener.groovy | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/groovy/gorm/logical/delete/PreQueryListener.groovy b/src/main/groovy/gorm/logical/delete/PreQueryListener.groovy index 330d056..5188937 100644 --- a/src/main/groovy/gorm/logical/delete/PreQueryListener.groovy +++ b/src/main/groovy/gorm/logical/delete/PreQueryListener.groovy @@ -49,7 +49,7 @@ class PreQueryListener implements ApplicationListener { log.debug "This entity [${entity.javaClass}] implements logical delete" if (!IGNORE_DELETED_FILTER.get()) { - query.eq('deleted', null) + query.isNull('deleted') } } } catch (Exception e) {