-
Type:
Task
-
Resolution: Unresolved
-
Priority:
Unknown
-
None
-
4
-
None
-
None
-
None
-
None
-
None
-
None
-
None
One of the two main goals of m2 (the other is the embedding of document).
Basically we are embedding Java array or list into one single BsonDocument field of BsonArray type. It roughly corresponds to @Embeddable JPA annotation semantics, though we don't necessarily use the annotation.
So for the following example entity class:
@Entity @Table(name = "movies") static class Movie { @Id int id; List<String> tags; }
the following document will be stored:
{ id: 1, tags: ['comedy', '3d'] }
This ticket only tackle simple case in the sense that the entity's array or list fields contains simple values (basic types supported by `MongoPreparedStatement` and `MongoResultSet`, as defined in m1), so no nested array or struct needs to be considered.
PoC testing case is at https://github.com/NathanQingyangXu/jpa-mongodb-mapping/blob/main/chameleon-core/src/test/java/org/hibernate/omm/type/aray/SimpleArrayFieldTests.java In this ticket we only focus on the first two methods.
Hibernate extension point:
- array type registration in Dialect
- is depended on by
-
HIBERNATE-77 implement $in and $nin comparison operator
-
- Backlog
-
-
HIBERNATE-75 Embedding BsonArray and BsonDocument in arbitrary way
-
- Ready for Work
-
-
HIBERNATE-63 Implementing simple array function filter
-
- Ready for Work
-
- related to
-
HIBERNATE-67 Implement $elemMatch based on unnest SQL function in Hibernate v7
-
- Backlog
-