greenDao 介绍
greenDAO是一个针对Android的轻快速ORM解决方案,它将对象映射到SQLite数据库。http://greenrobot.org/greendao/
greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases. http://greenrobot.org/greendao/
比SQLite更快地查找对象持久性?
查看我们的新移动数据库ObjectBox(GitHub)。
Looking for object persistence faster than SQLite? Check out our new mobile database ObjectBox (GitHub).
greenDAO是一个针对Android的轻而快速的ORM,它将对象映射到SQLite数据库。
由于对Android进行了高度优化,greenDAO提供了出色的性能,并且消耗了最少的内存。
greenDAO is a light & fast ORM for Android that maps objects to SQLite databases. Being highly optimized for Android, greenDAO offers great performance and consumes minimal memory.
主页、文档和支持链接:http://greenrobot.org/greendao/
Home page, documentation, and support links: http://greenrobot.org/greendao/
greenDAO的独特功能:
摇滚实体:greenDAO自2011年就开始使用,并被无数的著名应用所使用。
超级简单:简洁而直接的API,在V3中有注释
小:库是小于150 k的,它只是普通的Java jar(没有CPU依赖的本地部件)
快速:可能是Android最快的ORM,由智能代码生成驱动
安全而富有表现力的查询API:QueryBuilder使用属性常量来避免输入错误
功能强大的连接:跨实体查询,甚至连接复杂关系的链连接
灵活的属性类型:使用定制类或枚举来表示实体中的数据
加密:支持sql密码加密数据库
greenDAO's unique set of features:
- Rock solid: greenDAO has been around since 2011 and is used by countless famous apps
- Super simple: concise and straight-forward API, in V3 with annotations
- Small: The library is <150K and it's just plain Java jar (no CPU dependent native parts)
- Fast: Probably the fastest ORM for Android, driven by intelligent code generation
- Safe and expressive query API: QueryBuilder uses property constants to avoid typos
- Powerful joins: query across entities and even chain joins for complex relations
- Flexible property types: use custom classes or enums to represent data in your entity
- Encryption: supports SQLCipher encrypted databases
在您的项目中添加greenDAO
greenDAO在Maven中心提供。请确保您正在使用最新的版本,检查这里和这里
在你的Android项目中添加以下等级配置:
Add greenDAO to your project
greenDAO is available on Maven Central. Please ensure that you are using the latest versions by checking here and here
Add the following Gradle configuration to your Android project:
// 在你的根。gradle文件: 【】In your root build.gradle file:
buildscript {
repositories {
jcenter()
mavenCentral() // add repository
}
dependencies {
classpath 'com.android.tools.build:gradle:2.3.3'
classpath 'org.greenrobot:greendao-gradle-plugin:3.2.2' // add plugin
}
}
//在你的应用程序项目中。gradle文件:【】 In your app projects build.gradle file:
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao' // apply plugin
dependencies {
compile 'org.greenrobot:greendao:3.2.2' // add library
}
=====
请注意,这将把greenDAO Gradle 插件连接到您的构建过程中。
当您构建您的项目时,它会生成诸如DaoMaster、dao会话和DAOs之类的类。
Note that this hooks up the greenDAO Gradle plugin to your build process. When you build your project, it generates classes like DaoMaster, DaoSession and DAOs.
主页、文档链接
要了解更多关于greenDAO的信息,请查看greenDAO网站。
下面是一些你可能觉得有用的直接链接:
特征
greenDAO 3
文档
更新日志
技术常见问题解答
非技术常见问题解答
Homepage, Documentation, Links
For more details on greenDAO please check greenDAO's website. Here are some direct links you may find useful:
===
绿色机器人更多的开源软件
ObjectBox是一种新型的面向移动的面向对象的面向对象的数据库。
EventBus是一个针对Android的中央发布/订阅总线,它带有可选的交付线程、优先级和粘性事件。
一个很好的工具,可以将组件(例如活动、片段、逻辑组件)解耦。
要点是一组实用程序类和用于Android和Java项目的散列函数。
跟随我们在Google+上保持最新的状态。
More Open Source by greenrobot
ObjectBox is a new superfast object-oriented database for mobile.
EventBus is a central publish/subscribe bus for Android with optional delivery threads, priorities, and sticky events. A great tool to decouple components (e.g. Activities, Fragments, logic components) from each other.
Essentials is a set of utility classes and hash functions for Android & Java projects.
Follow us on Google+ to stay up to date.
=======
如何开始使用greenDAO,文档
对于greenDAO的第一步,请检查文档,特别是入门指南和入门教程。
How to get started with greenDAO, Documentation
For first steps with greenDAO, please check the documentation, especially the getting started guide and the introduction tutorial.
===
greenDAO文档
greenDAO Documentation
迁移到ObjectBox【】Migrating to ObjectBox
ObjectBox Daocompat- 从greenrobot迁移到快速的新的移动数据库【】ObjectBox DaoCompat – migrate to the fast new mobile database from greenrobot
迁移到greenDAO 3【】Migrating to greenDAO 3
从greenDAO 2迁移到版本3【】 Migrating from greenDAO 2 to version 3
教程和指引【】Tutorials and How-Tos
介绍,项目设置【】 Introduction – project setup
建模实体——模式和注释【】 Modelling entities – schema and annotations
会话——身份范围和会话缓存【】 Sessions – identity scope and session cache
查询——使用查询构建器【】 Queries – using the query builder
连接-多表连接和自连接【】 Joins – multi-table joins and self-joins
关系-对一个和多个实体之间的关系【】Relations – to-one and to-many relations between entities
定制类型——映射类和枚举到数据库值【】Custom types – mapping classes and enums to database values
数据库加密——使用sql密码 【】Database Encryption – using SQLCipher
API参考:JavaDocs 【】API Reference: JavaDocs
JavaDoc概述【】 JavaDoc overview
常见问题【】FAQs
技术常见问题解答【】 Technical FAQ
非技术FAQ(许可证等)【】 Non-technical FAQ (license etc.)
如果文件中没有涉及到的内容,或者可以改进,请告诉我们。【】If there is something not covered by the documentation or can be improved, please let us know.
===