Baike.dev
All toolsOnline toolsAI codingTrendingOpen sourceNewsSubmit
Log in
< Back to tools
G

greenDAO

> 编程语言
Open source

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

12.6K stars0 likes0 views
WebsiteGitHub

About

greenDAO is a light & fast ORM solution for Android that maps objects to SQLite databases.

⚠️ This project is not longer actively maintained. If you are looking for an easy to use and efficient database solution, please:

Check out ObjectBox

Check out our new mobile database ObjectBox (GitHub repo).

ObjectBox is a superfast object-oriented database with strong relation support. ObjectBox is embedded into your Android, Linux, macOS, or Windows app.

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.

Home page, documentation, and support links: https://greenrobot.org/greendao/ Features

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

Add greenDAO to your project

greenDAO is available on Maven Central. Please ensure that you are using the latest versions of the greendao and greendao-gradle-plugin artifact.

Add the following Gradle configuration to your Android project. In your root build.gradle file:

groovy
buildscript {
    repositories {
        jcenter()
        mavenCentral() // add repository
    }
    dependencies {
        classpath 'com.android.tools.build:gradle:<agp-version>'
        classpath 'org.greenrobot:greendao-gradle-plugin:3.3.1' // add plugin
    }
}

In your app modules app/build.gradle file:

groovy
apply plugin: 'com.android.application'
apply plugin: 'org.greenrobot.greendao' // apply plugin
 
dependencies {
    implementation 'org.greenrobot:greendao:3.3.0' // add library
}

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.

Continue at the Getting Started page.

R8, ProGuard

If your project uses R8 or ProGuard add the following rules:

bash
-keepclassmembers class * extends org.greenrobot.greendao.AbstractDao {
public static java.lang.String TABLENAME;
}
-keep class **$Properties { *; }

# If you DO use SQLCipher:
-keep class org.greenrobot.greendao.database.SqlCipherEncryptedHelper { *; }

# If you do NOT use SQLCipher:
-dontwarn net.sqlcipher.database.**
# If you do NOT use RxJava:
-dontwarn rx.**

Homepage, Documentation, Links

For more details on greenDAO please check greenDAO's website. Here are some direct links you may find useful:

Features

Getting Started

Documentation

Changelog

Technical FAQ

Non-Technical FAQ

Migrating to greenDAO 3

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.

Issues· 237 open

View all issuesOpen on GitHub
  • #1125

    org.greenrobot:greendao-gradle-plugin:3.3.1 and com.android.tools.build:gradle:9.0.0 versions are incompatible.

    Updated Jun 26, 2026
  • #1122

    In the latest version of the Sqlcipher component, the classpaths have been changed, and the affected classes have been adjusted

    Won't fixUpdated Nov 3, 2025
  • #1102

    Read this first! Check out our new database

    Updated Apr 1, 2025
  • #1110

    The project encountered errors after updating Gradle Version 7.6.1 to Gradle Version 8.0+

    BugConfirmedUpdated Jan 15, 2025
  • #1121

    Execution failed for task ':app:greendao' - UnsupportedEncodingException: UTF-

    More info requiredUpdated Oct 29, 2024
  • #1118

    Cannot use @TaskAction annotation on method

    BugMore info requiredUpdated Jul 9, 2024
  • #1115

    ... not supported with the configuration cache

    EnhancementUpdated Apr 15, 2024
  • #1075

    Greendao tasks should declare inputs and outputs

    Updated Apr 2, 2024
  • #1114

    error: cannot find symbol db.execSQL("CREATE TABLE " + constraint + "\ symbol: method makeConcatWithConstants(Lookup,String,MethodType,String) location: interface StringConcatFactory

    More info requiredUpdated Feb 5, 2024
  • #570

    Disable verbose logging in plugin by default

    EnhancementUpdated Jan 15, 2024

> Tags

Java

No comments yet. Be the first to share.

> Details

PublishedAug 1, 2026
UpdatedSep 28, 2026
Category编程语言
PricingOpen source

> Related tools

T
TypeScript
JavaScript 的超集,为前端与全栈提供静态类型
P
Python
通用编程语言,广泛用于 Web、数据与 AI
G
Go
Google 推出的简洁高效系统语言