Explicitly support/disallow all types from the org.bson.types package, UUID, BSON Binary Data subtypes for UUID and BinaryVector

XMLWordPrintableJSON

    • Type: New Feature
    • Resolution: Unresolved
    • Priority: Minor - P4
    • None
    • Affects Version/s: None
    • Component/s: Model
    • None
    • 3
    • None
    • None
    • None
    • None
    • None
    • None
    • None

      It is of importance to do this ticket before making the product available to the public.

      All the types in the org.bson.types package, as well as java.util.UUID are Serializable. This means:

      Thus, without us doing anything, Hibernate ORM stores values of those types using PreparedStatement.setBytes, where the bytes are the serialized value. This is not how we want these values to be stored. Given that the types "work" even now, if we don't do anything, and introduce proper support for these types after the product is first made available to the public, then such a change would be breaking. Therefore, before making the product available to the public, we should either explicitly support all of the types in org.bson.types, or explicitly forbid them. The latter is likely simpler, but still requires us to create and register with Hibernate ORM custom org.hibernate.type.descriptor.java.JavaType and/or org.hibernate.type.descriptor.jdbc.JdbcType for each of the types from org.bson.types.

      • Also, when reading persisted data, we should fail explicitly for BSON Binary Data subtypes we do not support (subtypes 3, 4 for UUID, and 9 for vector data).
      • UUID/BinaryVector may be represented either as a BsonBinary or UUID/BinaryVector. We better make sure both ways are either supported or disallowed.

            Assignee:
            Unassigned
            Reporter:
            Valentin Kavalenka
            None
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Created:
              Updated: