Room Database Library

Room Database Library

Room library is an abstraction layer on top of SQLite. Instead of using SQLite directly, Room simplifies the chores of setting up, configuration and interacting with the DB.

Let's have a quick overview.

There is 3 main components Room Database.

  • Entity
  • DAO
  • Database Class.

ENTITY

An entity represents a table in your app's database. Using annotation for every instance in the entity is among good practices.

Entity class


DAO

Database Access Object(DAO) provides the methods that your app uses to retrieve, update, insert and delete in the database.

DAO


DATABASE CLASS

The DB class holds the database and is the main access point for the underlying connection to your app's database. The database class provides your app with instances of the DAOs associated with that DB.

Database Abstract Class

要查看或添加评论,请登录

Shoaib K.的更多文章

社区洞察

其他会员也浏览了