android-contentprovider-generator
android-contentprovider-generator copied to clipboard
Easy projection generation + fixed "do all possible joins by default" problem
Hi!
I hope that these changes are quite useful. Now I can generate projections by *Selection objects like other criterias:
new ArticleSelection().forId().forTitle().forText().orderByDate().query(resolver);
// instead of
new ArticleSelection().orderByDate().query(resolver, new String[] {
ArticleColumns._ID, ArticleColumns.TITLE, ArticleColumns.TEXT
})
// Now default selection criteria:
new ArticleSelection().query(resolver);
// means
new ArticleSelection().query(resolver, ArticleColumns.ALL_COLUMNS);
// instead of
new ArticleSelection().query(resolver, null);
// which means large and dangerous set of joins like "article JOIN catalog JOIN domain JOIN ... etc"
Client should visibly declare the specific joining columns to do the specific join:
new ArticleSelection().forId().forTitle().forCatalogName().forDomainName().query(resolver);
// "article JOIN catalog JOIN domain
Thanks for your attention
Looks like this would solve the mentioned issue (#86). Any chance that this will get merged?
I am very sorry I haven't had the time to look at this yet. I can't promise anything, but I hope I will have some free time "soon" to look at it :) Again, sorry for the delay.