diff --git a/app/src/main/kotlin/jackall/moncalc/db/FruitRealmHelper.kt b/app/src/main/kotlin/jackall/moncalc/db/FruitRealmHelper.kt index 1211706..36f8d05 100644 --- a/app/src/main/kotlin/jackall/moncalc/db/FruitRealmHelper.kt +++ b/app/src/main/kotlin/jackall/moncalc/db/FruitRealmHelper.kt @@ -1,24 +1,25 @@ package jackall.moncalc.db -import jackall.moncalc.vo.Temple +import io.realm.Realm +import jackall.moncalc.vo.Fruit /** * Created by matsumoto_k on 2017/11/02. */ -class FruitRealmHelper : RealmHelper() { - override fun insert(realmObject: Temple) { - getRealm().use { realm -> - realm.executeTransaction { - realm.copyToRealmOrUpdate(realmObject) - } +class FruitRealmHelper : RealmHelper() { + override fun insert(mRealm: Realm, realmObject: Fruit) { + mRealm.executeTransaction { + mRealm.copyToRealmOrUpdate(realmObject) } } - override fun insert(realmObject: List) { - getRealm().use { realm -> - realm.executeTransaction { - realm.copyToRealmOrUpdate(realmObject) - } + override fun insert(mRealm: Realm, realmObject: List) { + mRealm.executeTransaction { + mRealm.copyToRealmOrUpdate(realmObject) } } + + override fun findAll(mRealm: Realm): List { + return mRealm.where(Fruit::class.java).findAll() + } } \ No newline at end of file