Cassandra issue - "The clustering keys ordering is wrong for @EmbeddedId"
在Java连接Cassandra的情况下, 当使用组合主键时, 默认第一个是Partition Key, 后续的均为Clustering Key.
如果有多个Clustering Key, 在Java中需指定Clustering Key的Order顺序, 否则将出现 "The clustering keys ordering is wrong for @EmbeddedId" 错误。
代码示例:
`@Entity(table = "table_name")
public class DemoDO {
@EmbeddedId
private CompoundKey id;
public static class CompoundKey {
@PartitionKey
@Column(name = "filed_one")
public String fieldOne;
@ClusteringColumn(1)
@Column(name = "field_two")
private String fieldTwo;
@ClusteringColumn(2)
@Column(name = "field_three")
private Date fieldThree;
public CompoundKey() {
}
public CompoundKey(String fieldOne, String fieldTwo, Date fieldThree) {
this.fieldOne= fieldOne;
this.fieldTwo= fieldTwo;
this.fieldThree= fieldThree;
}
...
}
@Column(name = "field_four")
private String fieldFour;
...
}
`
Cassandra issue - "The clustering keys ordering is wrong for @EmbeddedId"的更多相关文章
- Cassandra Issue with Tombstone
1. Cassandra is quicker than postgre and have lower change to lose data. Cassandra doesn't have fore ...
- Cassandra key说明——Cassandra 整体数据可以理解成一个巨大的嵌套的Map Map<RowKey, SortedMap<ColumnKey, ColumnValue>>
Cassandra之中一共包含下面5种Key: Primary Key Partition Key Composite Key Compound Key Clustering Key 首先,Prima ...
- 如何用 JIRA REST API 创建 Issue
简介 最近需要把一个Excel里的issues list全部到JIRA上create 一遍, 总不能手动创建百十来个issues吧, 本文讲述一下如果调用JIRA提供的Rest API 来自动创建is ...
- 未压缩的jQuery
/*! * jQuery JavaScript Library v3.4.1 * https://jquery.com/ * * Includes Sizzle.js * https://sizzle ...
- sizzle源码分析 (1)sizzle架构
sizzle是jquery的核心,它用来选择匹配的元素,其代码包含在一个匿名函数中,并以window作为其上下文环境: (function( window, undefined ) { //此处为si ...
- JavaScript中创建字典对象(dictionary)实例
这篇文章主要介绍了JavaScript中创建字典对象(dictionary)实例,本文直接给出了实现的源码,并给出了使用示例,需要的朋友可以参考下 对于JavaScript来说,其自身的Array对象 ...
- Sizzle一步步实现所有功能(基本筛选)
第二步:实现:first,:last,:eq(),even,odd,:gt(),:lt(); :header,:root,:taget; :not(). ;(function( window ){ v ...
- Sizzle一步步实现所有功能(层级选择)
第二步:实现Sizzle("el,el,el..."),Sizzle("el > el"),Sizzle("el el"),Sizzl ...
- [转]Android图片下载
因为国内被墙,看起来不方便,转载下,原文地址:http://android-developers.blogspot.com/2010/07/multithreading-for-performance ...
随机推荐
- C语言-数组
C语言中使用数组来存储相同类型的大批量数据. 数组: 数组名:起名规则和变量名一样: 定义数组:数组每个元素存储的数据类型+数组名[常量(时表示数组分配存储数据类型的个数也就是长度)]={每个元素,以 ...
- ubuntu内核的编译安装
原创声明:转载请注明出处. 一.操作环境: 1.ubuntu版本 2.linux原有内核版本 3.要安装的linux内核版本 linux-3.16.39 二.新内核的编译和安装 1.首先下载linux ...
- 转载 twisted(1)--何为异步
Reference: http://www.cnblogs.com/yueerwanwan0204/p/5589860.html 早就想写一篇文章,整体介绍python的2个异步库,twisted和t ...
- 如何设置打开jsp页面速度加快?
1.
- UVa 129 困难的串
https://uva.onlinejudge.org/index.php?option=com_onlinejudge&Itemid=8&page=show_problem& ...
- Aaron Swartz – 互联网天才开挂的人生历程:每时每刻都问自己,现在这世界有什么最重要的事是我能参与去做的?
Aaron说的一句话让我挺有感触的-- 相信你应该真的每时每刻都问自己,现在这世界有什么最重要的事是我能参与去做的? 如果你没在做那最重要的事,那又是为什么? 1986年11月8日,有个叫Aaron ...
- iOS 协议
协议分为三部分:声明.引用.实现. 通常,声明协议和声明协议类型的属性都是在同一个类中.声明协议和声明协议作为属性在头文件中,引用在声明类的实现文件中.而实现协议则在其它类中.
- 2.4. 属性(Core Data 应用程序实践指南)
属性的名称必须以小写字母开头. 添加 name 和 quantity 属性.
- Struts框架中struts-config.xml文件配置小结
弄清楚struts-config.xml中各项元素的作用,对于我们构建web项目有莫大的好处.<struts-config>是struts的根元素,它主要有8个子元素,DTD定义 如下: ...
- main函数执行前、后再执行的代码
一.main结束 不代表整个进程结束 (1)全局对象的构造函数会在main 函数之前执行, 全局对象的析构函数会在main函数之后执行: 用atexit注册的函数 ...