-
-
Save mucahidkambur/18557113640a22c4102e70586a93bc4f to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import android.arch.persistence.room.Database; | |
import android.arch.persistence.room.Room; | |
import android.arch.persistence.room.RoomDatabase; | |
import android.content.Context; | |
@Database(entities = {Uye.class}, version = 1) | |
public abstract class RepoDatabase extends RoomDatabase { | |
private static final String DB_NAME = "veri.db"; | |
private static volatile RepoDatabase instance; | |
static synchronized RepoDatabase getInstance(Context context){ | |
if(instance == null){ | |
instance = create(context); | |
} | |
return instance; | |
} | |
private static RepoDatabase create(final Context context){ | |
return Room.databaseBuilder( | |
context, | |
RepoDatabase.class, | |
DB_NAME).build(); | |
} | |
public abstract UyeDao getUyeDao(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment