Spring 找不到请求的操作集 <varchar> <-> java.util.Set 的数据 Cassandra 编解码器
Spring Data Cassandra codec not found for requested operation set<varchar> <-> java.util.Set
我的实体有一个字段
@Column("authorizations")
@Builder.Default
private Map<String, Set<String>> authorizations = new HashMap<>();
当我通过 Spring 数据存储库查询该对象时出现异常
CodecNotFoundException: Codec not found for requested operation:
[set <-> java.util.Set]
尽管写入工作正常。我不敢相信这不是开箱即用的支持。
Table定义
CREATE TABLE resource_authorization_rules(
resource text,
region text,
authorizations map<text, frozen<set<text>>>,
PRIMARY KEY (resource, region)
);
可能是类型擦除的东西。如何以最少的努力解决这个问题?
这是 Spring Data Casasndra 的限制。有个JIRA for improving support of frozen collections. And it looks like that it could be worked around with custom row mapper as .
P.S。 DataStax Java 驱动程序在其对象映射器中有 corresponding annotations。
我的实体有一个字段
@Column("authorizations")
@Builder.Default
private Map<String, Set<String>> authorizations = new HashMap<>();
当我通过 Spring 数据存储库查询该对象时出现异常
CodecNotFoundException: Codec not found for requested operation: [set <-> java.util.Set]
尽管写入工作正常。我不敢相信这不是开箱即用的支持。
Table定义
CREATE TABLE resource_authorization_rules(
resource text,
region text,
authorizations map<text, frozen<set<text>>>,
PRIMARY KEY (resource, region)
);
可能是类型擦除的东西。如何以最少的努力解决这个问题?
这是 Spring Data Casasndra 的限制。有个JIRA for improving support of frozen collections. And it looks like that it could be worked around with custom row mapper as
P.S。 DataStax Java 驱动程序在其对象映射器中有 corresponding annotations。