JPA,CMP和BMP

时间:2016-09-27 06:52:33

标签: java-ee ejb-3.0

我是.NET开发人员。我在2003年在大学学习过Java,特别是J2EE

我学习了诸如容器管理持久性(CMP)和 Bean管理持久性(BMP)之类的术语。

根据this Wikipedia page Java Persistence API 已取代CMP。我猜Bean管理持久性仍然是一个使用中的术语。

➥这是正确的还是取代了BMP作为一个术语?

我了解JPAORM中的.NET类实体框架。对于简单的应用程序(使用简单的SQL)和Bean管理的持久性,可以将JPA用于复杂的SQL。

➥这是正确的还是复杂的SQL(有很多连接)可用 - 或许类似于.NET的LINQ

1 个答案:

答案 0 :(得分:1)

BMP and CMP have been considered legacy technologies since JPA was introduced into the Java EE 5 specifications in 2006.

They became optional in Java EE implementations with the release of the EJB 3.2 specification that is associated with Java EE 7.

You are correct that JPA is an ORM framework. It fully supports complex queries with multiple joins using the SQL like JPQL language, as well as "native" queries where absolutely needed. Furthermore, it is possible to compose fully type safe queries on the fly in Java using the Criteria API.