I am using UserType 3.0.0.RC1 to map JodaMoney to Hibernate.
I am stuck in error while initializing SessionFactory:
PersistentMoneyAmount requires that currencyCode be defined as a parameter or property DefaultCurrencyCode Hibernate, which must be defined
I am sure that I should have a setup problem - these are the relevant snippets.
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"/> </properties> </persistence-unit>
Corresponding spring config:
<bean id="entityManagerFactory" class="org.springframework.orm.jpa.LocalContainerEntityManagerFactoryBean"> <property name="dataSource" ref="dataSource" /> <property name="packagesToScan"> <list> <value>com.mangofactory.concorde</value> <value>com.mangofactory.moolah</value> </list> </property> <property name="persistenceUnitName" value="spring-jpa" /> <property name="jpaVendorAdapter"> <bean class="org.springframework.orm.jpa.vendor.HibernateJpaVendorAdapter"> <property name="showSql" value="true" /> <property name="databasePlatform" value="org.hibernate.dialect.MySQLDialect" /> </bean> </property> </bean>
Any tips on what I am missing?
source share