-
Type:
New Feature
-
Resolution: Unresolved
-
Priority:
Major - P3
-
None
-
3
-
None
-
None
-
None
-
None
-
None
-
None
-
None
In https://jira.mongodb.org/browse/HIBERNATE-62, we focus on non-null fields. This ticket complements with it to tackle the following two cases:
- comparison with existing field with `null` value explicitly
- comparison with missing field
Note that this ticket is different from https://jira.mongodb.org/browse/HIBERNATE-71, which focuses on `is null` (`is not null`) predicate which returns boolean value, in the sense that this ticket will focus on explicit comparison like`= null` (`!= null`).
Since Hibernate v6.3 (see https://hibernate.atlassian.net/browse/HHH-16843), Hibernate will interpret such nullness comparison as returning `null` value, as per the ternary behaviour of `null`. However, in context a predicate is required (e.g. where clause), null value will be treated as false.
see https://docs.jboss.org/hibernate/orm/6.6/querylanguage/html_single/Hibernate_Query_Language.html#null-values-and-ternary-logic for null's ternary logic.
Also note that MongoDB's comparison operator treats null and missing fields in the same way (see https://www.mongodb.com/docs/manual/reference/bson-type-comparison-order/#non-existent-fields), so this ticket won't depend on https://jira.mongodb.org/browse/HIBERNATE-48.
Addressing the source code notes tagged with TODO-HIBERNATE-74 is in scope of this ticket.
- is related to
-
HIBERNATE-48 Design and implement storing/reading null and empty values
-
- Ready for Work
-
-
HIBERNATE-71 'is Null' ('is not null') MQL translation
-
- Ready for Work
-