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

More integer primary key enhancements #202

Closed sbosley closed 8 years ago

sbosley commented 8 years ago

The core goal of this change is mainly to generate named aliases of the getters and setters for INTEGER PRIMARY KEY properties. (Before the only way to access these properties was with getRowId() and setRowId(), which could be confusing). These aliases use the property name, but delegate to getRowId() and setRowId() under the hood for consistent behavior.

Much of this refactor is just code reorganization. It removes the burden of tracking the ROWID property or INTEGER PRIMARY KEY rowid alias from TableModelFileWriter and moves this responsibility into the TableModelFieldSpec plugin, which is a more natural place for it and makes it easier to achieve the getter/setter behavior. This allows us to remove a lot of special case handling and duplicated code from the file writer classes.

jdkoren commented 8 years ago

Should the files in squidb-gen be gitignored?

sbosley commented 8 years ago

@jdkoren we can clean up the sample project in a separate PR if we want, but let's leave it as is for this one at least.

jdkoren commented 8 years ago

LGTM