开发者

JPA2 -- Where is EntityManager.detach?

开发者 https://www.devze.com 2022-12-31 18:22 出处:网络
I read in several places that JPA2 will support a detach method call on Entity Manager.I am running with Hibernate 3.5.1-FINAL and Spring 3.0.2-RELEASE as Maven dependencies -- snagged from the JBoss

I read in several places that JPA2 will support a detach method call on Entity Manager. I am running with Hibernate 3.5.1-FINAL and Spring 3.0.2-RELEASE as Maven dependencies -- snagged from the JBoss repository.

Isn't this enough?

Perhaps th开发者_如何学Ce problem is with my javax.persistence.EntityManager interface definition. Do I need to update javax? How does one do this?


You don't even need to declare hibernate-jpa-2.0-api 1.0.0.FINAL as dependency, you get it transitively from hibernate-entitymanager 3.5.1.Final. Running mvn dependency:tree would confirm this.


Well, I figured it out. My maven project (at the top level) had a dependency on javax.persistence persistence-api 1.0. I took this out and replaced it with hibernate-jpa-2.0-api 1.0.0.FINAL and viola...i have detach!

0

精彩评论

暂无评论...
验证码 换一张
取 消