sockeqwe / sqlbrite-dao

DAO for SQLBrite
http://hannesdorfmann.com/android/sqlbrite-dao
Apache License 2.0
182 stars 22 forks source link

Support for auto-value / auto-parcel #17

Closed sockeqwe closed 8 years ago

sockeqwe commented 8 years ago

I guess it shouldn't be to hard to support auto-value and derives like auto-parcel. We could annotate abstract methods and use the generated builder to instantiate an item.

However, that would require to change the way the annotation processor works right now: Currently you annotate a setter method with @Column. However, auto-value doesn't generate a setter method. So we have to change that to annotate getters. In non auto-value powered classes we additionally have to check if there is a corresponding setter for the @Column annotated getter method.

An alternative would be to add a dedicated annotation for auto-value powered classes. However, I think one annotation for everything is desired and should be enough. The annotation processor is already abstract enough to distinguish between different implementations.

Also related to ContentValuesBuilder #2

sockeqwe commented 8 years ago

DAO module and sqlbrite works perfectly fine with Auto-Value-Cursor: https://github.com/gabrielittner/auto-value-cursor Therefore is no need to do the same job again.