SQLite Made Easy : Room Persistence Library

Room persistence library introduced at Google I/O 2017 provides an abstraction layer over the SQLite database Room is a new way to create a database in your android apps, it is much similar to OrmLite. It provides enhance security, easy access, easy to setup and quick to get started with new database. All DML(Data Manipulation Language) commands are now annotated except SELECT command which works with @Query. Room takes care of these concerns for you while providing an abstraction layer over SQLite. 1) Database 2) Entity 3) DAO There are three major components in room: Entity represents data for a single table row, constructed an annotated java data object. Each entity is persisted into its own table. DAO (Data Access Object) defines the method that access the database, using annotation to bind SQL to each method. Database is a holder class that uses annotation to define the list of entities and database version. This class content defines the list of DAOs. ...