2016-07-28 57 views
0

我試圖創建一個Spring和jpa項目。 谷歌搜索後,我發現通過使用休眠模式,這是可能的:springConfiguration.xml如何檢測persistence.xml

<property name="persistenceUnitName" value="HiSpring"/> 

不過,我想只用彈簧和JPA沒有休眠。 有可能嗎?

在此先感謝。

回答

0

這是LocalContainerEntityManagerFactoryBean的屬性,它創建了EntityManagerFactory這是一個JPA類(與Hibernate無關)。然而,JPA只是一個規範,你需要爲它提供一個可能是Hibernate或其他東西的實現。

+0

您好,感謝您的回覆。你能幫我解決這個錯誤:http://stackoverflow.com/questions/38647592/sp​​ring-jpa-configuration-error – saria

0

JPA是一個具有不同實現的規範。 如果你願意,你可以使用Hibernate的JPA實現或其他的實現。

你可以看看上Spring Data JPA它可以幫助你輕鬆地與所有CRUD操作創建庫

+0

你好,謝謝你的回覆。你能幫我解決這個錯誤:http://stackoverflow.com/questions/38647592/sp​​ring-jpa-configuration-error – saria