Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/cassandra/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Java UDT在Spring数据中的应用_Java_Cassandra_Spring Data - Fatal编程技术网

Java UDT在Spring数据中的应用

Java UDT在Spring数据中的应用,java,cassandra,spring-data,Java,Cassandra,Spring Data,我已经在cassandra中创建了自定义定义的类型,并尝试使用spring插入数据。起初,我认为使用这样的实体是可行的: @PrimaryKeyColumn(name = "appid", ordinal = 0, type = PrimaryKeyType.PARTITIONED) private String appid; @PrimaryKeyColumn(name = "event", ordinal = 1, type = PrimaryKeyType.PARTITIONED, ord

我已经在cassandra中创建了自定义定义的类型,并尝试使用spring插入数据。起初,我认为使用这样的实体是可行的:

@PrimaryKeyColumn(name = "appid", ordinal = 0, type = PrimaryKeyType.PARTITIONED)
private String appid;
@PrimaryKeyColumn(name = "event", ordinal = 1, type = PrimaryKeyType.PARTITIONED, ordering = Ordering.ASCENDING)
private String event;
@PrimaryKeyColumn(name = "date", ordinal = 2, type = PrimaryKeyType.CLUSTERED, ordering = Ordering.DESCENDING)
private Date date;
@PrimaryKeyColumn(name = "userid", ordinal = 3, type = PrimaryKeyType.PARTITIONED)
private String userid;
@Column (name = "items")
@Frozen
private Map<CassandraEventParamModel,CassandraEventStatsModel> items;
但是我不断地得到一个错误,它说

 Invocation of init method failed; nested exception is org.springframework.data.cassandra.mapping.VerifierMappingExceptions:
Cassandra entities must have the @Table, @Persistent or @PrimaryKeyClass Annotation
我想知道使用spring数据向cassandra传递数据的正确方法是什么

谢谢

 Invocation of init method failed; nested exception is org.springframework.data.cassandra.mapping.VerifierMappingExceptions:
Cassandra entities must have the @Table, @Persistent or @PrimaryKeyClass Annotation