Back to Exposed

compositeMoney

docs/api/exposed-money/org.jetbrains.exposed.v1.money/composite-money.html

1.2.02.9 KB
Original Source

compositeMoney

fun Table.compositeMoney(precision: Int, scale: Int, amountName: String, currencyName: String = amountName + "_C"): CompositeMoneyColumn<BigDecimal, CurrencyUnit, MonetaryAmount>

Creates a composite column made up of:

  • A numeric column, with the specified amountName, for storing numbers with the specified precision and scale.

  • A character column, with the specified currencyName, for storing currency (as javax.money.CurrencyUnit).

Samples

org.jetbrains.exposed.v1.money.MoneyDefaultsTest.TableWithDBDefault


fun Table.compositeMoney(amountColumn: Column<BigDecimal>, currencyColumn: Column<CurrencyUnit>): CompositeMoneyColumn<BigDecimal, CurrencyUnit, MonetaryAmount>

Creates a composite column made up of a decimal column and a currency column.

Samples

org.jetbrains.exposed.v1.money.MoneyBaseTest.testUsingManualCompositeMoneyColumns


@JvmName(name = "compositeMoneyNullable")

fun Table.compositeMoney(amountColumn: Column<BigDecimal?>, currencyColumn: Column<CurrencyUnit?>): CompositeMoneyColumn<BigDecimal?, CurrencyUnit?, MonetaryAmount?>

Creates a composite column made up of a nullable decimal column and a nullable currency column.

Samples

org.jetbrains.exposed.v1.money.MoneyBaseTest.testUsingManualCompositeMoneyColumns

Generated by Dokka © 2026 Copyright