UserType / Hibernate / JodaMoney error : PersistentMoneyAmount requires currencyCode to be defined as a parameter

前端 未结 3 1802
孤街浪徒
孤街浪徒 2021-01-24 20:20

I\'m using UserType 3.0.0.RC1 to map JodaMoney to Hibernate.

I\'m stuck with an error when the SessionFactory initialises:

PersistentMoneyAmount r

3条回答
  •  遥遥无期
    2021-01-24 21:10

    if you're looking for an annotation based solution, you may try this

    @Type(type = "org.jadira.usertype.moneyandcurrency.joda.PersistentMoneyAmount", parameters = { @Parameter(name="currencyCode", value="USD") })
    private Money price;
    

    found here

    Email Archive: usertype-discuss (read-only)

提交回复
热议问题