Here, you will find frequently asked questions about greenDAO in general. If you have a question about developing with greenDAO, please check the technical FAQ.
General
Why does greenDAO use code generation? Why not annotations?
Code generation is the very reason greenDAO came into existence! Annotation based solution have major drawbacks on Android: they have to rely on parsing meta data and on reflection. Especially reflection is slow on Android which degrades the performance of other ORM tools significantly. greenDAO, on the other hand, generates optimized code for Android. The generated code avoids reflection completely. That’s the primary reason greenDAO is so fast. Another advantage is size: greenDAO’s core library is very small (below 100k including unit tests). The reason for this is that some ORM logic is inside the generator and not in the core library.
Licensing
Under which license is greenDAO available?
greenDAO consists of the sub projects DaoCore, DaoGenerator, and DaoTest. DaoCore is the library needed to distribute your apps and is available under the Apache license version 2. DaoGenerator is the Java program responsible for generating your entity, DAO and other files. DaoTest is the unit test suite to ensure greenDAO itself is and stays stable. DaoGenerator and DaoTest are available under the GPL V3. These license terms should be fine for the vast majority of uses cases for greenDAO. Contact us, if you like to discuss alternatives.
Can I use greenDAO for commercial projects for free?
Yes! greenDAO’s core library, which you need to include in your project, is available under the permissive Apache 2 license.