Uploaded image for project: 'Ignite'
  1. Ignite
  2. IGNITE-15784

Support custom mapping for fields and column of arbitrary types.

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Fixed
    • None
    • 3.0.0-alpha4
    • sql
    • Docs Required, Release Notes Required

    Description

      Motivation.

      A user may want to operate with user objects, which types may differ from or incompatible with a column type.
      As a special case, a user may want to transparently serialize an arbitrary object to byte[] (BLOB) column.

      Description.

      To achieve this we can provide an interface for the converter and allow passing custom converters to a mapper.
      The converter acts as an interceptor and transforms a value before writing to/after reading from the column.
      Mapper API should be refactored as well to support this.

      As a PoC, let's add a test with a converter that performs transparent Java serialization arbitrary object to byte[] column.

      Converters and automatic typecasting is out of the scope,
      the goal is to create API and infrastructure for further extension, e.g.

      • provide a standard converter component for cross-platform serialization (based on MessagePack or on IGNITE-15944 ticket ideas)
      • optionally add JSON/BSON format support.
      • add simple converters for supported native types, e.g. Integer<-->String, and possibly, support implicit typecasting.
      • support unsigned types via implicit typecasting mechanics.

      Attachments

        Issue Links

          Activity

            People

              amashenkov Andrey Mashenkov
              amashenkov Andrey Mashenkov
              Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved:

                Time Tracking

                  Estimated:
                  Original Estimate - Not Specified
                  Not Specified
                  Remaining:
                  Remaining Estimate - 0h
                  0h
                  Logged:
                  Time Spent - 2h 40m
                  2h 40m