Map operation with UDT (user type) in cassandra

Say I have a product table in Kassandra and UDT Information

Create table Product{
    id text,
    details map<text,<frozen<Information>>,
    detailsMore list<frozen<Information>>
}
Create Type Information{
    info1 text,
    info2 text
}

For them, I have two classes in Java as

@Table
Class Product{
String id;
Map<String, Information> details;
List<Information> details;
}
@UserDefinedType('Information')
Class Information{
String info1;
String info2;
}

Now I retrieve data using CRUDRepository (spring), and now I love

Product prodObj = repo.find(id);

Now this prodObj contains data like

details map<String,UDTValue>,
detailsMore list<Information>

Why is the user type converted to Information in the case of the List, but was not converted in the case of the Map? Or am I doing something wrong? . If I directly try to assign this UDTValue Information Card, I get the following exception (obviously). java.lang.ClassCastException: com.datastax.driver.core.UDTValue cannot be passed to Information

0
1

, UDTValue Information. , Java ( ).

: Spring Cassandra Mapper, , Map Mapper Java. , @UDT, . - (. output ).

+1

Source: https://habr.com/ru/post/1663180/


All Articles