Monday, April 16, 2012

How to get object from many-to-many related tables using Cursor

Could anybody writes me how to use Cursor on two tables in many-to-many relation?
For example we have tables:



BOOKS(id, title)

AUTHORS(id, name)

BOOKSAUTHORS(bookId, authorId)


and we have a classes



class Book{
int id;
String title;
List<Author> authors;
}

class Author{
int id;
String name;
}


How using Cursor get object of Book class with filled list of authors?





No comments:

Post a Comment