yahoo / squidb

SquiDB is a SQLite database library for Android and iOS
https://github.com/yahoo/squidb/wiki
Apache License 2.0
1.31k stars 132 forks source link

Code generator creates model object with wrong parameters and forgets to import classes #184

Closed dotWee closed 8 years ago

dotWee commented 8 years ago

I'm currently upgrading my project from 2.0.2 to SquiDB 3.0.0.

@TableModelSpec(className = "Image", tableName = "images")
public class ImageSpec {

    @ColumnSpec(constraints = "NOT NULL")
    long postId;

    @ColumnSpec(constraints = "NOT NULL")
    long postTimestamp;

    @ColumnSpec(constraints = "NOT NULL")
    String postUrl;
}

I went through multiple clean rebuilts and even manually deleted previous generated model classes.

I did not include the squidbOptions 'androidModels' configuration to my gradle.build file and moved ContentValues usages to ContentValuesStorage. Parcelable features aren't used and not accessed.

Now the code generator creates a model object with multiple issues. Some method parameters are wrong, shown in the first screenshot below. issue1

Non-existing methods are still being included in the constructor. issue2

And imports for parcelable are missing, even through android specific features aren't enabled. issue3

Any ideas how to fix this?

dotWee commented 8 years ago

Well... I forgot to bump the apt processor to 3.0.0.