diff --git a/app/src/main/kotlin/jackall/overlaymulticounter/db/BaseRealmHelper.kt b/app/src/main/kotlin/jackall/overlaymulticounter/db/BaseRealmHelper.kt new file mode 100644 index 0000000..af0f1f0 --- /dev/null +++ b/app/src/main/kotlin/jackall/overlaymulticounter/db/BaseRealmHelper.kt @@ -0,0 +1,18 @@ +package jackall.overlaymulticounter.db + +import io.realm.Realm +import io.realm.RealmModel +import io.realm.RealmResults + +/** + * Created by matsumoto_k on 2017/11/08. + */ +abstract class BaseRealmHelper { + protected val realm by lazy { Realm.getDefaultInstance() } + abstract fun insert(realmObject: T) + abstract fun update(realmObject: T) + abstract fun findAll(): RealmResults + fun close() { + realm.close() + } +} \ No newline at end of file