DATABASE: log with assigned id
This commit is contained in:
parent
4260ca7b11
commit
9eafb449b3
3 changed files with 2 additions and 15 deletions
|
@ -15,7 +15,7 @@ class InsertBolusWithTempIdTransaction(
|
||||||
val result = TransactionResult()
|
val result = TransactionResult()
|
||||||
val current = database.bolusDao.findByPumpTempIds(bolus.interfaceIDs.temporaryId!!, bolus.interfaceIDs.pumpType!!, bolus.interfaceIDs.pumpSerial!!)
|
val current = database.bolusDao.findByPumpTempIds(bolus.interfaceIDs.temporaryId!!, bolus.interfaceIDs.pumpType!!, bolus.interfaceIDs.pumpSerial!!)
|
||||||
if (current == null) {
|
if (current == null) {
|
||||||
database.bolusDao.insert(bolus)
|
bolus.id = database.bolusDao.insert(bolus)
|
||||||
result.inserted.add(bolus)
|
result.inserted.add(bolus)
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
|
@ -1,13 +0,0 @@
|
||||||
package info.nightscout.database.impl.transactions
|
|
||||||
|
|
||||||
import info.nightscout.database.entities.GlucoseValue
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Creates the GlucoseValue
|
|
||||||
*/
|
|
||||||
class InsertGlucoseValueTransaction(val glucoseValue: GlucoseValue) : Transaction<Unit>() {
|
|
||||||
|
|
||||||
override fun run() {
|
|
||||||
database.glucoseValueDao.insert(glucoseValue)
|
|
||||||
}
|
|
||||||
}
|
|
|
@ -15,7 +15,7 @@ class InsertTemporaryBasalWithTempIdTransaction(private val temporaryBasal: Temp
|
||||||
val result = TransactionResult()
|
val result = TransactionResult()
|
||||||
val current = database.temporaryBasalDao.findByPumpTempIds(temporaryBasal.interfaceIDs.temporaryId!!, temporaryBasal.interfaceIDs.pumpType!!, temporaryBasal.interfaceIDs.pumpSerial!!)
|
val current = database.temporaryBasalDao.findByPumpTempIds(temporaryBasal.interfaceIDs.temporaryId!!, temporaryBasal.interfaceIDs.pumpType!!, temporaryBasal.interfaceIDs.pumpSerial!!)
|
||||||
if (current == null) {
|
if (current == null) {
|
||||||
database.temporaryBasalDao.insert(temporaryBasal)
|
temporaryBasal.id = database.temporaryBasalDao.insert(temporaryBasal)
|
||||||
result.inserted.add(temporaryBasal)
|
result.inserted.add(temporaryBasal)
|
||||||
}
|
}
|
||||||
return result
|
return result
|
||||||
|
|
Loading…
Reference in a new issue