How can I map a single Scala value to multiple columns in the database? For example:
Consider mapping class Transaction as defined below:
case class Transaction(time: Date, amount: MonetaryValue)
Where MonetaryValue is defined as:
case class MonetaryValue(amount: BigDecimal, currencyCode: String)
to a table like so:
transactions:
time datetime
amount decimal
currency_code varchar
Looking at the code, ColumnType is sealed so not sure how something like this would be possible.
How can I map a single Scala value to multiple columns in the database? For example:
Consider mapping class
Transactionas defined below:Where MonetaryValue is defined as:
to a table like so:
Looking at the code,
ColumnTypeissealedso not sure how something like this would be possible.