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

Converter should not ignore @CassandraType for collection like type

    XMLWordPrintable

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 3.0 RC1 (Neumann)
    • Component/s: None
    • Labels:
      None
    • Last commented by a User:
      true

      Description

      Collection like data types will ignore declared `@CassandraType` if CustomConverter is is registered

      For example, if we have following entity

      @Value
      @Table
      static class Sample{
         @Id String id;
      
         @CassandraType(type = CassandraType.Name.TEXT)
         List<String> collectionAsString;
         @CassandraType(type = CassandraType.Name.LIST, typeArguments = CassandraType.Name.TEXT)
         List<String> collectionAsList;
      }
       

      and register converter `List<String> <-> String` then it will be applied to field `collectionAsList` as well even though it is explicitly marked as `LIST`

      Note, even if we were to change argument type to int for the `collectionAsList` the `List<String> -> Sring` converter will still be applied which might be an issue on itself

       

      Similarly, if mark collection type with 2 different cassandra types, only one of converters will be used for both

      @Value
      @Table
      static class SimpleSample{
         @Id String id;
      
         @CassandraType(type = CassandraType.Name.TEXT)
         byte[] bytesAsHexString;
         @CassandraType(type = CassandraType.Name.BLOB)
         byte[] bytesAsBlob;
      } 

       

       

       

        Attachments

          Activity

            People

            Assignee:
            mp911de Mark Paluch
            Reporter:
            L.Swiatek Łukasz Świątek
            Last updater:
            Mark Paluch
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

              Dates

              Created:
              Updated:
              Resolved:
              Days since last comment:
              16 weeks ago