0

I'm looking into greenDAO as an option for our database mapping needs. I noticed that greenDao does not use annotation processing, but instead uses a handmade java program to generate the source code.

Having just finished a small utility which uses annotation processing for generating code at compile time (to be used with Android ContentProviders), I wonder if greenDao ever considered using annotation processing and, if yes, why it was decided not to.

I would like to hook the code generation with the compile cycle of our Android projects and it would be nice if we could skip the extra step in creating the SourceGenerator project.

AngraX
  • 1,803
  • 2
  • 18
  • 30

2 Answers2

0

First of all, I'm not a member of greendao. I'm just using it for some time now (and extended it to my needs). So some of my information is just a guess or my opinion.

I don't think greendao will support annotation-processing in near future, since there is nothing on their projects page. Furthermore I think there are other features which seem more important.

For example:

  • Joins
  • ContentResolvers
  • extended code generators

On top of that I think database-structure shouldn't change as much as code does, so it is completely ok to have the code generation in a separate project, keeping the build-process of the app faster. This may be a reason for not using annotations.

I'm using greendao for about 6 months now and I am at DB-Version 23. I am glad the generation didn't take place every time I built the project.

AlexS
  • 5,295
  • 3
  • 38
  • 54
0

Greendao now supports annotation processing!

It is a feature in the latest major release (greenDao 3.0).

Check out the migration guide!

kykrueger
  • 106
  • 7