Android: SQLite one-to-many design

前端 未结 3 860
情歌与酒
情歌与酒 2020-12-13 22:49

Anyone has good advise on how to implement one-to-many mapping for SQLite using ContentProvider? If you look at Uri ContentProvider#insert(Ur

3条回答
  •  臣服心动
    2020-12-13 23:30

    You can use ContentProviderOperations for this.

    They are basically bulk operations with the ability to back-reference to the identifiers generated for parent rows.

    How ContentProviderOperations can be used for a one-to-many design is very well explained in this answer: What are the semantics of withValueBackReference?

提交回复
热议问题