CodecNotFoundException:找不到请求的操作的编解码器:['org.apache.cassandra.db.marshal.ByteType'<->字节]

时间:2019-04-17 07:55:21

标签: java cassandra

使用Java数据映射器查询下表时,看到一个奇怪的问题:“ com.datastax.driver.core.exceptions.CodecNotFoundException:找不到请求的操作的编解码器:['org.apache.cassandra.db.marshal.ByteType '<->字节] “

应该将CQL tinyint自动映射到Java驱动程序中的字节吗?什么是ByteType?

CREATE TABLE abc.test (
  cityID int,
  planUUID UUID,
  versionID TIMEUUID,     
  status tinyint,
  PRIMARY KEY (cityID, planUUID, versionID)
) WITH CLUSTERING ORDER BY (planUUID DESC, versionID DESC);

@Data
@Table(keyspace = "abc", name = "test")
public class TestSet {
  @PartitionKey private int cityID;

  @ClusteringColumn @NonNull private UUID planUUID;

  @ClusteringColumn(1)
  private UUID versionID;

  private byte status;
}

0 个答案:

没有答案