greenDAO README

The project's README from github.com/greenrobot/greenDAO. As one markdown file: README.md.

⚠️ 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/

Build Status Follow greenrobot on Twitter

Features

greenDAO's unique set of features:

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:

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:

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:

-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.**

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.

greenDAO (greenrobot/greenDAO)

Searching Database…

12.6K ·GitHub
What is this?greenDAO is a lightweight ORM that maps Java objects to SQLite databases on Android, generating DAO classes at build time so you don't write SQL by hand.
Is it a standalone app or something I add to my Android project?It's a library plus a Gradle plugin: you add the greendao and greendao-gradle-plugin artifacts to your Android project, and it generates DaoMaster, DaoSession, and DAO classes during the build.
How do I add it to a project?greenDAO is on Maven Central: add the greendao and greendao-gradle-plugin dependencies to your root build.gradle and your app module's build.gradle, then build your project to generate the DAO classes.
Do I need anything beyond standard Android/Gradle tooling?Just a standard Android project with Gradle; no native dependencies since the library is plain Java (it does support optional SQLCipher for encryption).
Is this still actively maintained?No — the project is no longer actively maintained; the greenrobot team now recommends ObjectBox as the maintained alternative.
Can my database be encrypted?Yes, greenDAO supports SQLCipher-encrypted SQLite databases for apps that need encryption.
What makes greenDAO's query API different from raw SQL strings?Its QueryBuilder uses property constants instead of raw column name strings, so queries are type-safe and avoid typos.
Can greenDAO handle complex relations between entities?Yes, it supports powerful joins across entities, including chaining multiple joins for complex relations.
Does it need special ProGuard/R8 rules?Yes, if your project uses R8 or ProGuard you need to add specific keep rules for greenDAO, which are documented in the README.
Creator
greenrobot
Size
7.2 MB
Stars
12.6K
Age
14y
Commits · 90 Days