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
Regarding the need to configure seed - this is due to a bug in 3.0.0-RC1 and will be fixed in future.
I ended up solving this using the following configuration in my persistence.xml
:
<persistence-unit name="spring-jpa">
<properties>
<property name="hibernate.format_sql" value="true"/>
<property name="hibernate.hbm2ddl.auto" value="update"/>
<property name="jadira.usertype.autoRegisterUserTypes" value="true"/>
<property name="jadira.usertype.currencyCode" value="AUD"/>
<property name="jadira.usertype.seed" value="org.jadira.usertype.spi.shared.JvmTimestampSeed"/>
</properties>
</persistence-unit>
The tricky part is that I needed to provide a jadira.usertype.seed
in order for the jadira.usertype.currencyCode
to be detected.
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)