I defined the below type and table in cassandra for persisting some information.
CREATE TYPE attributes (
value text,
operator text,
dataType text
);
CREATE TABLE management.meta (
type varchar,
values map<text, frozen <list< attributes >>>,
PRIMARY KEY (type)
);
I'm getting error ""Only primitive types are allowed inside Collections for property [values] of type ['interface java.util.Map'] in entity" when I define a entity to perform CRUD operation. We are using com.datastax.cassandra 3.1.4 version. Below is my entity definition:
@CassandraType(type = DataType.Name.MAP, typeArguments = {DataType.Name.TEXT, DataType.Name.UDT}, userTypeName = "attributes")
private Map<String, List<RulesAttributesType>> values;
@UserDefinedType("attributes")
public static class AttributesType {
@CassandraType(type = DataType.Name.TEXT)
private String value;
@CassandraType(type = DataType.Name.TEXT)
private String operator;
@CassandraType(type = DataType.Name.TEXT)
private String dataType;
}
I see an JIRA issue that states Java Spring doesn’t support User Defined Type (UDT) in Maps.
Any thoughts on how to handle this?