From 5456651fede6670b090a618e90ee2225f20bc97e Mon Sep 17 00:00:00 2001 From: BoD Date: Thu, 30 Oct 2014 22:42:23 +0100 Subject: [PATCH 1/9] Reverting to commit 7871607d40d125b9212acf0f20f4ea22c77de8da --- README.md | 5 +- etc/sample/app/res/layout/main.xml | 6 -- .../sample/app/SampleActivity.java | 21 +----- .../sample/provider/SampleProvider.java | 74 ++++--------------- .../sample/provider/base/AbstractCursor.java | 4 +- .../sample/provider/base/AliasCursor.java | 74 ------------------- .../provider/company/CompanyColumns.java | 25 +------ .../sample/provider/person/PersonColumns.java | 55 ++------------ .../sample/provider/team/TeamColumns.java | 25 +------ pom.xml | 2 +- .../androidcontentprovidergenerator/Main.java | 8 -- .../model/Entity.java | 30 -------- .../abstractcursor.ftl | 4 +- .../aliascursor.ftl | 47 ------------ .../columns.ftl | 30 +------- .../contentprovider.ftl | 62 ++++------------ 16 files changed, 50 insertions(+), 422 deletions(-) delete mode 100644 etc/sample/app/src/org/jraf/androidcontentprovidergenerator/sample/provider/base/AliasCursor.java delete mode 100644 src/main/resources/org/jraf/androidcontentprovidergenerator/aliascursor.ftl diff --git a/README.md b/README.md index ff4ebef..c7a299d 100644 --- a/README.md +++ b/README.md @@ -118,7 +118,7 @@ https://github.com/BoD/android-contentprovider-generator/releases/latest ### Run the tool -`java -jar android-contentprovider-generator-1.8.1-bundle.jar -i -o ` +`java -jar android-contentprovider-generator-1.8.0-bundle.jar -i -o ` - Input folder: where to find `_config.json` and your entity json files - Output folder: where the resulting files will be generated @@ -195,6 +195,7 @@ In this example, the field `main_team_id` is a foreign key referencing the prima #### Limitations - **Only one foreign key to a particular table is allowed per table.** In the example above only one column in `person` can point to `team`. +- **Columns of joined tables must have unique names.** In the example above there must not be a column `name` both in `person` and in `team`. You can just prefix their name with the table name (i.e. `person_name`, `team_name`). - **Loops** (i.e. A has a foreign key to B and B has a foreign key to A) **aren't detected.** The generator will infinitely loop if they exist. - Foreign keys always reference the `_id` column (the implicit primary key of all tables) and thus must always be of type `Long` - by design. @@ -206,7 +207,7 @@ You need maven to build this tool. `mvn package` -This will produce `android-contentprovider-generator-1.8.1-bundle.jar` in the `target` folder. +This will produce `android-contentprovider-generator-1.8.0-bundle.jar` in the `target` folder. Similar tools diff --git a/etc/sample/app/res/layout/main.xml b/etc/sample/app/res/layout/main.xml index 7feeb33..a1ae944 100644 --- a/etc/sample/app/res/layout/main.xml +++ b/etc/sample/app/res/layout/main.xml @@ -34,10 +34,4 @@ android:layout_height="wrap_content" android:text="Query people with team and company" /> -