EJB和JPA如何相关? [英] How does EJB and JPA relate?
问题描述
我正在阅读Action 3中的EJB 3,我有以下问题:
您编写的POJO是用@Entity编写的,也是一个EJB实体类型的注释?
I am reading the EJB 3 in Action book and I have the following question :
Is the POJO's you write and annotate with @Entity and so on also a EJB entity type?
我不明白JPA与EJB有什么关系。 JPA现在不是一个自己的规范吗?实体也包含在自己的持久性容器中。他们谈论EJB 3 Java Persistence API等,但我不明白实体与EJB有什么关系。
I don't understand what JPA has to do with EJB. Isn't JPA a own specification now? The entities are also contained in a own persistence container. They talk about EJB 3 Java Persistence API etc. but I don't understand what entities has to do with EJB.
推荐答案
JPA已被设计为替换EJB2实体bean,并已作为EJB3规范的一部分启动。
JPA has been designed to replace EJB2 entity beans, and has started as a part of the EJB3 specification.
由于在EJB容器之外也使用JPA是有意义的,它现在有自己的规范,但它仍然与EJB3相关,因为兼容的EJB3容器必须提供一个JPA实现,它集成到容器的事务处理中。
Since it makes sense to also use JPA outside of an EJB container, it has now its own specification, but it's still related to EJB3, since a compliant EJB3 container has to provide a JPA implementation, which integrates into the transaction handling of the container.
这篇关于EJB和JPA如何相关?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!