Skip to content

How to map multi-column values? #65

@kutchar

Description

@kutchar

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions