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 ...
随机推荐
- 【Xilinx-Petalinux学习】-05-OpenCV程序测试
占位, 通过上一次编译的opencv库,运行程序,实现图像处理
- [noip2013]货车运输(kruskal + 树上倍增)
描述 A 国有 n 座城市,编号从 1 到 n,城市之间有 m 条双向道路.每一条道路对车辆都有重量限制,简称限重.现在有 q 辆货车在运输货物,司机们想知道每辆车在不超过车辆限重的情况下,最多能运多 ...
- 快速搭建LNMP
[centos 6.4 server]系统安装请参考:http://blog.zhuyin.org/748.html1.防火墙设置: iptables -F service iptables save ...
- StackExchange.Redis 官方文档(三) Events
事件 ConnectionMultiplexer类型提供了很多可以用来了解表面状态下正在发生着什么的事件.这对日志是很有用的. ConfigurationChanged - ConnectionMul ...
- WPF中ContextMenu通过CommandParameter传参
场景:ListBox中有个ContextMenu,希望点击其中一个菜单项的时候把ListBox当做CommandParameter传递给Command,但是发现无论是通过ElementName还是Re ...
- linux上编译安装python2.7.5
下载python2.7.5,保存到 /data/qtongmon/software http://www.python.org/ftp/python/ 解压文件 tar xvf Python-2.7. ...
- Centos下wget下载整个网站,或者目录全部文件
需要下载某个目录下面的所有文件.命令如下 wget -c -r -np -k -L -p www.xxx.org/pub/path/ 在下载时.有用到外部域名的图片或连接.如果需要同时下载就要用-H参 ...
- 用JS的数组缓存一些东西
var cache_index = new Array(); //首页的ajax缓存 //ajax 推荐的游戏和软件 function change_tuijian(sid,div_class){ i ...
- 解决NetStream.appendBytes直播爆音的问题解决
研究了一下Adobe家HDS的具体实现 OSMF.利用其中的一个核心方法 flash.net.NetStream.appendBytes()构建了我们自己的HTTP点直播播放框架.但今年年初发现一个问 ...
- Flex timer使用 keydown事件注册到stage
Flex timer使用 keydown事件注册到stage: <?xml version="1.0" encoding="utf-8"?> < ...