简体   繁体   English

EJB 2.1实体bean与EJB 3.0实体bean

[英]EJB 2.1 Entity beans vs. EJB 3.0 Entity beans

I had this doubt for sometime now, some people say that there's no such thing called entity beans in EJB 3.0. 我有一段时间怀疑这个问题,有些人说EJB 3.0中没有称为实体bean的东西。 Is there any possibility to say so, EJB 3.0 uses JPA to persist the data and there's no enhancement to the entity beans from the previous version (EJB 2.1) it's just brought back.Another fact is EJB 2.1 uses abstract POJOs and EJB 3.0 uses non-abstract POJOs. 有没有可能这么说,EJB 3.0使用JPA来持久保存数据,并且没有对先前版本(EJB 2.1)中的实体bean进行任何增强,而是刚刚带回来。另一个事实是EJB 2.1使用抽象POJO而EJB 3.0使用非-abstract POJOs。 I need some clear description about these facts. 我需要对这些事实做一些清晰的描述。

The entities managed by EJB3/JPA are not EJBs, they're just POJOs. EJB3 / JPA管理的实体不是EJB,它们只是POJO。 The entities in EJB 1/2, however, are EJBs, with strict restrictions on their hierarchy. 但是,EJB 1/2中的实体是EJB,对其层次结构有严格的限制。

EJB2-style entities are now completely redundant, they're only supported in EJB3 containers for backwards compatibility. EJB2样式的实体现在完全是冗余的,它们仅在EJB3容器中受支持以实现向后兼容。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM