转:http://stackoverflow.com/questions/15250609/greendao-primary-key-on-multiple-columns

Does GreenDAO support primary key on multiple columns?

I'm using Property's method primaryKey() on two columns but it doesn't work. I'm getting exception:

Caused by: android.database.sqlite.SQLiteException: table "table" has more than one primary key

How to create primary key on multiple columns? Should I edit generated DAO classes?

=======================================================================

The documentation says:

Currently, entities must have a long or Long property as their primary key. [...] To work around this issue, you can use a long primary key and use an unique index for the intended “key” properties.

GreenDAO - primary key on multiple columns的更多相关文章

  1. 分区实践 A PRIMARY KEY must include all columns in the table's partitioning function

    MySQL :: MySQL 8.0 Reference Manual :: 23 Partitioning https://dev.mysql.com/doc/refman/8.0/en/parti ...

  2. 1503 - A PRIMARY KEY must include all columns in the table's partitioning function

    1503 - A PRIMARY KEY must include all columns in the table's partitioning function 错误的原因:表的主键字段必须包含分 ...

  3. Error Code: 1068. Multiple primary key defined

    1.错误描述 10:10:38 alter table user add num int(8) primary key first Error Code: 1068. Multiple primary ...

  4. mysql:[Err] 1068 - Multiple primary key defined

    添加主键时,出现错误:[Err] 1068 - Multiple primary key defined #增加主键 ) not null; ; alter table my_test add pri ...

  5. Database Primary key and Foreign key [From Internet]

    Database Primary key and Foreign key --Create Referenced Table CREATE TABLE Department ( DeptID int ...

  6. MySQL Crash Course #01# Chapter 1. 2 概念. Primary key

    索引 database table schema Primary Key MySQL 书的第一章介绍一些基本的概念.理解数据库是掌握 MySQL 非常重要的一个部分. 第二章简单介绍了 MySQL 以 ...

  7. Hibernate Id Generator and Primary Key

    Use automate id by hibernate: If you want the tables' id be created automation. How to do it? When u ...

  8. primary key与unique的区别

    定义了 UNIQUE 约束的字段中不能包含重复值,可以为一个或多个字段定义 UNIQUE 约束.因此,UNIQUE 即可以在字段级也可以在表级定义, 在UNIQUED 约束的字段上可以包含空值.ORA ...

  9. 【原创】大数据基础之Kudu(3)primary key

    关于kudu的primary key The primary key may not be changed after the table is created. You must drop and ...

随机推荐

  1. linux shell 脚本攻略学习8---md5校验,sort排序,uniq命令详解

    一.校验与核实 目前最为出名的校验技术是md5sum和sha1sum,它们对文件内容使用相应的算法来生成校验和. 举例: amosli@amosli-pc:~/learn$ md5sum text.t ...

  2. Spring 3.0 AOP 之 AOP 术语 (一)

    关于AOP.之前我已写过一个系列的随笔: <自己实现简单的AOP>,它的关注点在于实现.实现语言是C#,实现方式为 自定义实现 RealProxy 抽象类.重写Invoke方法,以便进行方 ...

  3. TestNg的IReporter接口的使用

    IReporter接口是干嘛的?就是让用户自定义报告的,很多人想要自定义报告,于是乎找各种插件,比如什么testng-xslt啊,reportng啊,各种配置,最后出来的结果,还不能定制化,但为什么不 ...

  4. 超高频RFID模块

    1.应用开发有两种方法:串口和USB 2.从逻辑上将标签存储器分为四个存储区,每个存储区可以由一个或一个以上的存储器字组成.这四个存储区是: 00 保留区(Password):前两个字是销毁(kill ...

  5. POJ 2391 Ombrophobic Bovines (Floyd + Dinic +二分)

    Ombrophobic Bovines Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 11651   Accepted: 2 ...

  6. android 蓝牙编程重点---如何发送和接收16进制数据

    最近的android蓝牙开发项目也逐渐接近尾声,基本的功能都已经完成,只剩下界面的设计.现在真的是舒了一口气! 作为编程学习经验只有1年的菜鸟,这是我独自完成的商业性产品,而且还是涉及到与单片机蓝牙模 ...

  7. 验证时出错。HRESULT = &#39;8000000A&#39;

    这本来是在VS2005下创建的一下项目,后来改用VS2010的开发环境,.NET Framework的版本号还是使用2.0, 但每次生成之后都会在解决方式的同级文件夹下产生一个名称乱码的文件夹, 攻克 ...

  8. 解决WIN32窗口不响应WM_LBUTTONDBLCLK消息

    原文链接: http://www.cnblogs.com/xukaixiang/archive/2012/05/27/2520059.html 今天在做一个软件时,发现win32创建的窗体不能响应WM ...

  9. nginx根据http_user_agent防DDOS

    前端squid反向代理到nginx nginx根据http_user_agent防DDOS 首先查看访问日志,找出可疑访问 找到http_user_agent 的特征,然后再作过滤 "Moz ...

  10. Python 文件 close() 方法

    描述 Python 文件 close() 方法用于关闭一个已打开的文件.关闭后的文件不能再进行读写操作, 否则会触发 ValueError 错误. close() 方法允许调用多次. 当 file 对 ...