Advertisement
Guest User

Untitled

a guest
Jun 24th, 2019
108
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.55 KB | None | 0 0
  1. @Database(entities = {Orders.class}, version = 1,exportSchema = false)
  2.  
  3. private static CacheDatabase INSTANCE;
  4.  
  5. public abstract OrdersDao ordersDao();
  6.  
  7. public static CacheDatabase getInMemoryDatabase(Context context) {
  8. if (INSTANCE == null) {
  9. INSTANCE =
  10. Room.databaseBuilder(context.getApplicationContext(), CacheDatabase.class, "CacheDb.sql")
  11. .allowMainThreadQueries()
  12. .build();
  13. }
  14. return INSTANCE;
  15. }
  16.  
  17. public static void destroyInstance() {
  18. INSTANCE = null;
  19. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement