我使用UserType 3.0.0.RC1中的org.jadira.usertype.dateandtime.joda.PersistentDateTime
类将JodaTime DateTime
映射到Hibernate。 The Javadocs为类提到有'databaseZone'和'jvmZone'属性,我想设置,但我找不到任何在UserType文档中指出如何执行此操作。我发现this thread这似乎意味着,这些都是通过XML类似于以下设置:UserType/Hibernate/JodaTime - 在哪里设置UserType全局属性?
<prop key="jadira.usertype.autoRegisterUserTypes">true</prop>
<prop key="jadira.usertype.databaseZone">jvm</prop>
我尝试添加这些我Hibernate的配置,但只是给了一个错误。有谁知道这个配置需要去哪里?谢谢。
谢谢,但不幸的是我没有一个persistence.xml文件;在我正在开发的项目中,我们已经在Spring管理的'session-factory'bean中配置了所有这些属性。很高兴知道替代方案在那里。 –