Newer
Older
MonCalc / app / src / main / kotlin / jackall / moncalc / db / TempleRealmHelper.kt
package jackall.moncalc.db

import io.realm.RealmResults
import jackall.moncalc.vo.Temple

/**
 * Created by matsumoto_k on 2017/11/02.
 */
class TempleRealmHelper : RealmHelper<Temple>() {
    override fun insert(realmObject: Temple) {
        realm.executeTransaction {
            realm.copyToRealmOrUpdate(realmObject)
        }
    }

    override fun insert(realmObject: List<Temple>) {
        realm.executeTransaction {
            realm.copyToRealmOrUpdate(realmObject)
        }
    }

    override fun findAll(): RealmResults<Temple> {
        return realm.where(Temple::class.java).findAll()
    }
}