Spring Data Cassandra UDT

时间:2018-03-14 22:16:34

标签: spring cassandra user-defined-types

春季版:4.3.14 Spring数据cassandra版本:1.5.10

您好, 我正在使用Spring Data Cassandra,我有以下域对象

@table
Public class Ticket {
   String tickernum;
   String ticketName;
   List<Subscriber> subscriber;

}


@UserDefinedType()
public class subscriber {
  String imsi;
  String msisdn;
  String name;
}

在我的cassandra数据库中,我已将订户定义为UDT(用户定义类型)。

我正在尝试使用Ticket有效负载发布一个帖子请求,以#34;创建一张票&#34;

但是,我收到以下错误:

12:15:21,259  WARN DefaultHandlerExceptionResolver:384 - Failed to read HTTP message: org.springframework.http.converter.HttpMessageNotReadableException: JSON parse error: Cannot construct instance of `com.datastax.driver.core.UDTValue` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator); nested exception is com.fasterxml.jackson.databind.exc.InvalidDefinitionException: Cannot construct instance of `com.datastax.driver.core.UDTValue` (no Creators, like default construct, exist): cannot deserialize from Object value (no delegate- or property-based Creator)

有谁知道如何解决这个问题?

1 个答案:

答案 0 :(得分:0)

为订户UDT尝试@UserDefinedType(无括号)