我使用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中配置了所有這些屬性。很高興知道替代方案在那裏。 –