SHARE
TWEET

Untitled

a guest Jun 24th, 2019 62 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
Not a member of Pastebin yet?
Sign Up, it unlocks many cool features!
 
Top