>>, "availabl-6ren">
gpt4 book ai didi

java - 集合$UnmodifyingRandomAccessList Cassandra 冰雪奇缘 map

转载 作者:行者123 更新时间:2023-12-02 01:42:42 24 4
gpt4 key购买 nike

我的表中有一个以下 UDT

productsinfo FROZEN<productsinfo>

这是 productsinfo 的 UDT 架构

"owned_product_details" map<text, FROZEN<list<FROZEN<productdetails>>>>,
"available_product_details" map<text, FROZEN<list<FROZEN<productdetails>>>>

产品详细信息 UDT 有一些文本字段

当我尝试使用 Java 插入值时,它抛出异常

java.lang.NullPointerException: at index 1
at com.google.common.collect.ObjectArrays.checkElementNotNull(ObjectArrays.java:239)
at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:230)
at com.google.common.collect.ObjectArrays.checkElementsNotNull(ObjectArrays.java:225)
at com.google.common.collect.ImmutableList.construct(ImmutableList.java:281)
at com.google.common.collect.ImmutableList.of(ImmutableList.java:85)
at com.datastax.driver.core.DataType.map(DataType.java:462)
at com.datastax.driver.core.DataType.map(DataType.java:475)
at org.springframework.data.cassandra.core.mapping.BasicCassandraPersistentProperty.getDataTypeFor(BasicCassandraPersistentProperty.java:223)
at org.springframework.data.cassandra.core.mapping.BasicCassandraPersistentProperty.findDataType(BasicCassandraPersistentProperty.java:186)
at org.springframework.data.cassandra.core.mapping.BasicCassandraPersistentProperty.getDataType(BasicCassandraPersistentProperty.java:169)
at org.springframework.data.cassandra.core.mapping.CassandraMappingContext.getDataTypeWithUserTypeFactory(CassandraMappingContext.java:571)
at org.springframework.data.cassandra.core.mapping.CassandraMappingContext.getDataType(CassandraMappingContext.java:536)
at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.getCodec(MappingCassandraConverter.java:151)
at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.writeUDTValue(MappingCassandraConverter.java:657)
at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.write(MappingCassandraConverter.java:391)
at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.getWriteValue(MappingCassandraConverter.java:822)
at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.getWriteValue(MappingCassandraConverter.java:749)
at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.writeUpdateFromWrapper(MappingCassandraConverter.java:478)
at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.write(MappingCassandraConverter.java:383)
at org.springframework.data.cassandra.core.convert.MappingCassandraConverter.write(MappingCassandraConverter.java:365)
at org.springframework.data.cassandra.core.QueryUtils.createUpdateQuery(QueryUtils.java:132)
at org.springframework.data.cassandra.core.CassandraTemplate.update(CassandraTemplate.java:584)

在调试时我发现了这个

suppressedExceptions    Collections$UnmodifiableRandomAccessList<E>  (id=317)   

以下是Java中的实体类

@Column("productsinfo")
@CassandraType(type = DataType.Name.UDT, userTypeName = "productsinfo")
private ProductsInfo productsInfo;

@Column("owned_product_details")
@CassandraType(type = DataType.Name.MAP, typeArguments = { DataType.Name.TEXT, DataType.Name.LIST })
private Map<String, List<ProductDetails>> ownedProductDetails;

@Column("available_product_details")
@CassandraType(type = DataType.Name.MAP, typeArguments = { DataType.Name.TEXT, DataType.Name.LIST })
private Map<String, List<ProductDetails>> availableProductDetails;

最佳答案

https://jira.spring.io/browse/DATACASS-651修复了这个问题,您可以在更新到某个版本 >=2.2 RC1 后重试吗?

关于java - 集合$UnmodifyingRandomAccessList<E> Cassandra 冰雪奇缘 map ,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/57478838/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com