BoD / android-contentprovider-generator

A tool to generate Android ContentProviders.
GNU General Public License v3.0
619 stars 151 forks source link

Easy projection generation + fixed "do all possible joins by default" problem #88

Open yargray opened 9 years ago

yargray commented 9 years ago

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

frigus02 commented 9 years ago

Looks like this would solve the mentioned issue (#86). Any chance that this will get merged?

BoD commented 9 years ago

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.