I'm using JodaMoney library and the Jadira User types to store monetary values. I want to be able to store a single currency per table, instead of needing so many fields.
Is there a way to map the currencies to the same field? This doesn't work because it complains I can't mix insertable and updatable.
@Columns(columns = {@Column(name = "currency"), @Column(name = "productsAmount")})
@Type(type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyAmountAndCurrency")
private Money totalProducts;
@Columns(columns = { @Column(name = "currency", insertable = false, updatable= false), @Column(name = "orderTotalAmount") })
@Type(type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyAmountAndCurrency")
private Money orderTotalAmount;