Before implementing ternary logic handling for null comparisons (= null, != null), we need to define the intended semantic model - whether the MongoDB Hibernate integration should follow three-valued logic (3VL), as Hibernate 6.3 does, or two-valued logic (2VL), which may simplify behavior and better align with MongoDB’s handling of missing and null fields.
Context:
- Hibernate 6.3+ interprets null comparisons as returning null (per 3VL), treated as false in predicate contexts.
- MongoDB compares missing and null values equally, effectively operating as 2VL.
- Implementation work for null comparison behavior is tracked in HIBERNATE-270
- Related tickets:
HIBERNATE-62- handling non-null fieldsHIBERNATE-71- handling is null and is not null predicates
Acceptance criteria:
- Evaluate pros and cons of adopting 3VL (consistency with Hibernate) vs. 2VL (consistency with MongoDB semantics)
- Document the chosen model and rationale.
- Provide implementation guidance for HIBERNATE-270 based on the decision
- blocks
-
HIBERNATE-270 Support SQL / Ternary Null Semantics
-
- Needs Triage
-
- is depended on by
-
HIBERNATE-71 'is Null' ('is not null') MQL translation
-
- Closed
-