转: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. jsp页面如何读取从后台传来的json

    ===================================问====================================== var obj = jQuery.parseJSO ...

  2. HDUOJ-----Robot Motion

    Robot Motion Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Tota ...

  3. Linux下Setuid命令! 转载

    Linux下Setuid命令! 转载  在Linux系统中每个普通用户都可以更改自己的密码,这是合理的设置. 问题是:用户的信息保存在文件/etc/passwd中,用户的密码保存在文件/etc/sha ...

  4. Swift 类型检查与类型转换

    前言 在 Swift 语言中一般使用 is 关键字实现类型检查,使用 as 关键字实现类型转换,除此之外还可以通过构造器和方法来实现类型转换. 1.类型检查 1.1 使用 is 检查 类型检查操作符 ...

  5. SpringMVC整合Mongodb开发,高级操作

    开发环境: 操作系统:windows xpMongodb:2.0.6依 赖 包:Spring3.2.2 + spring-data-mongodb-1.3.0 + Spring-data-1.5 +  ...

  6. idea13注册机

    public class Keygen { /** * @param s * @param i * @param bytes * @return */ public static short getC ...

  7. mysql 创建函数问题

    ERROR 1418 (HY000): This function has none of DETERMINISTIC, NO SQL, or READS SQL DATA in its declar ...

  8. Python读文本文件中文乱问题

    file_object = open('thefile.txt')try: all_the_text = file_object.read().decode("gb2312")fi ...

  9. 【转】Scheme 编程环境的设置

    Scheme 编程环境的设置 介绍了这么久的 Scheme,却没有讲过如何配置一个高效的 Scheme 的编程环境.有些人开始学习 Scheme 的时候感觉无从下手,所以今天讲一下它的配置. Sche ...

  10. RocketMQ os.sh 系统优化(CentOS)

    贴出源码中的优化脚本先: #!/bin/sh # # Execute Only Once # echo 'vm.overcommit_memory=1' >> /etc/sysctl.co ...