P
P
PhilipFry2014-04-05 17:01:27
Java
PhilipFry, 2014-04-05 17:01:27

ContentProvider and One to many relationship

There are tables User, Post, Content. The user has a lot of posts and the post has a lot of content.
The Post and Content tables have a field that is a foreign key and refers to the User and Post tables, respectively.
Thus, when creating a post, I specify the id of the user who created it. And when creating content, I specify the id of the post to which it belongs.
And here I don't understand how to implement the method:

@Override
    public Uri insert(Uri uri, ContentValues contentValues) {
}

And in that case, what would the Uri look like?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question