Uploaded image for project: 'Spring Data for Apache Cassandra'
  1. Spring Data for Apache Cassandra
  2. DATACASS-413

Reading Enum collections creates collections containing String values

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: 1.5 GA (Ingalls)
    • Component/s: Core
    • Labels:
      None
    • Last commented by a User:
      true
    • Sprint:
      Kay M2

      Description

      There seems to be no read conversation for columns with a set of enumerations. The writing is okay as the enumerations are written as a set of text values. The reading leads to a set of type Set<MyEnumeration> holding string values.

      My column definition is:

      my_set frozen<set<text>>
      

      and the correspending java definition is:

      @Column("my_set")
      private Set<MyEnumeration> eventTypes;
      

      A solution for my issue was to write and register custom @WritingConverter (MyEnumeration, String) and @ReadingConverter (String, MyEnumeration).

      The resolution of a single EnumerationType to Text (Cassandra) works as it should.

      The necessary new EnumNameCodec<>(MyEnumeration.class) is registered properly.

        Attachments

          Activity

            People

            Assignee:
            mp911de Mark Paluch
            Reporter:
            adam.wehner Adam Wehner
            Last updater:
            Oliver Drotbohm
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              3 years, 28 weeks, 6 days ago