GreenDAO - primary key on multiple columns
转: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的更多相关文章
- 分区实践 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 ...
- 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 错误的原因:表的主键字段必须包含分 ...
- 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 ...
- mysql:[Err] 1068 - Multiple primary key defined
添加主键时,出现错误:[Err] 1068 - Multiple primary key defined #增加主键 ) not null; ; alter table my_test add pri ...
- Database Primary key and Foreign key [From Internet]
Database Primary key and Foreign key --Create Referenced Table CREATE TABLE Department ( DeptID int ...
- MySQL Crash Course #01# Chapter 1. 2 概念. Primary key
索引 database table schema Primary Key MySQL 书的第一章介绍一些基本的概念.理解数据库是掌握 MySQL 非常重要的一个部分. 第二章简单介绍了 MySQL 以 ...
- 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 ...
- primary key与unique的区别
定义了 UNIQUE 约束的字段中不能包含重复值,可以为一个或多个字段定义 UNIQUE 约束.因此,UNIQUE 即可以在字段级也可以在表级定义, 在UNIQUED 约束的字段上可以包含空值.ORA ...
- 【原创】大数据基础之Kudu(3)primary key
关于kudu的primary key The primary key may not be changed after the table is created. You must drop and ...
随机推荐
- 浅谈 iOS 与 H5 的交互- JavaScriptCore 框架
前言 小的作为一个iOS程序猿,可能研究JavaScript以及H5相关的知识并不是为了真正的要去转行做这一方面,其实更多的为了要研究OC中的JavaScriptCore框架,JavaScriptCo ...
- Redis学习之路(001)- Redis介绍以及安装(Linux)
redis是当前比较热门的NOSQL系统之一,它是一个key-value存储系统.和Memcached类似,但很大程度补偿了memcached的不足,它支持存储的value类型相对更多,包括strin ...
- Socket编程:之TCP案例
转载请加上博文引用:http://i.cnblogs.com/EditPosts.aspx?postid=5733248&update=1 服务端: #include <stdio.h& ...
- VC对话框使用OnEraseBkgnd函数位图背景并透明
1.使用OnEraseBkgnd函数实现对话框位图背景 BOOL CDisplayBmpBackGroundDlg::OnEraseBkgnd(CDC *pDC) { CRect rect; GetC ...
- ggplot2-设置坐标轴
本文更新地址:http://blog.csdn.net/tanzuozhev/article/details/51107583 本文在 http://www.cookbook-r.com/Graphs ...
- 【转】java原理—反射机制
一.什么是反射:反射的概念是由Smith在1982年首次提出的,主要是指程序可以访问.检测和修改它本身状态或行为的一种能力.这一概念的提出很快引发了计算机科学领域关于应用反射性的研究.它首先被程序语言 ...
- 【转载并整理】JAVA解析或生成xml的四种方法
参考文章 1:http://blog.csdn.net/clemontine/article/details/53011362 2:http://www.jb51.net/article/98456. ...
- 安卓listview滚动时背景变黑的解决方法
ListView是常用的显示控件,默认背景是和系统窗口一样的透明色,如果给ListView加上背景图片,或者背景颜色时,滚动时listView会黑掉, 原因是,滚动时,列表里面的view重绘时,用的依 ...
- extjs4学习-02-导入相关文件
在WebContent下创建extjs4目录. 将extjs项目文件中的resource文件夹和ext-all.js.ext-all.js.ext-all-debug.js文件拷贝进去.
- HBase中多Filter查询示例
在Hbase查询中有时需要用到多个Filter关联的查询. 代码如下: ArrayList<Filter> listForFilters = new ArrayList<Filter ...