From 0927e3a4b15d1fc0184249d27a23855b712dece6 Mon Sep 17 00:00:00 2001 From: Hongwei Date: Fri, 2 May 2025 11:48:48 +0200 Subject: [PATCH] refactor/update BankAccountBalance to use KeyedMapper for improved key handling --- .../scala/code/bankaccountbalance/BankAccountBalance.scala | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/obp-api/src/main/scala/code/bankaccountbalance/BankAccountBalance.scala b/obp-api/src/main/scala/code/bankaccountbalance/BankAccountBalance.scala index 5f6e0712c..68443de9d 100644 --- a/obp-api/src/main/scala/code/bankaccountbalance/BankAccountBalance.scala +++ b/obp-api/src/main/scala/code/bankaccountbalance/BankAccountBalance.scala @@ -8,10 +8,13 @@ import net.liftweb.mapper._ import net.liftweb.util.Helpers.tryo -class BankAccountBalance extends BankAccountBalanceTrait with LongKeyedMapper[BankAccountBalance] with CreatedUpdated with IdPK { +class BankAccountBalance extends BankAccountBalanceTrait with KeyedMapper[String, BankAccountBalance]{ override def getSingleton = BankAccountBalance + // Define BalanceId_ as the primary key + override def primaryKeyField = BalanceId_.asInstanceOf[KeyedMetaMapper[String, BankAccountBalance]].primaryKeyField + object BankId_ extends MappedUUID(this) object AccountId_ extends MappedUUID(this) object BalanceId_ extends MappedUUID(this) @@ -33,4 +36,4 @@ class BankAccountBalance extends BankAccountBalanceTrait with LongKeyedMapper[Ba override def balanceAmount: BigDecimal = Helper.smallestCurrencyUnitToBigDecimal(BalanceAmount.get, foreignMappedBankAccountCurrency) } -object BankAccountBalance extends BankAccountBalance with LongKeyedMetaMapper[BankAccountBalance] {} +object BankAccountBalance extends BankAccountBalance with KeyedMetaMapper[String, BankAccountBalance] with CreatedUpdated {}