[android-developers] Joins vs. Content provider

2011-03-10 Thread Jay Bloodworth
Is there a standard or recommended idiom for doing the equivalent of a
join of data in a local database versus a content provider?  is there
anything more efficient than explicitly looping on the result set from
the local database query and doing individual queries of the content
provider to grab the related rows?

Jay

-- 
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en


Re: [android-developers] Joins vs. Content provider

2011-03-10 Thread Kostya Vasilyev
Not sure I understand the question: the implementation of a 
ContentProvider doesn't have to map data URIs to one particular table each.


It's probably the most obvious thing to do, but it doesn't have to be 
this way. You can map URIs to DB queries any way you like, and include 
JOIN's if needed (just use db.rawQuery for this).


And then there is:

http://developer.android.com/reference/android/database/CursorJoiner.html

if you need to do the join yourself. Which is just a simple helper class 
that makes joins more efficient by requiring that both result sets (left 
 right) are sorted.


-- Kostya

10.03.2011 22:40, Jay Bloodworth пишет:

Is there a standard or recommended idiom for doing the equivalent of a
join of data in a local database versus a content provider?  is there
anything more efficient than explicitly looping on the result set from
the local database query and doing individual queries of the content
provider to grab the related rows?

Jay




--
Kostya Vasilyev -- http://kmansoft.wordpress.com

--
You received this message because you are subscribed to the Google
Groups Android Developers group.
To post to this group, send email to android-developers@googlegroups.com
To unsubscribe from this group, send email to
android-developers+unsubscr...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/android-developers?hl=en