Java – EJB 2.1 Entity beans vs. EJB 3.0 Entity beans

ejbjava

I had this doubt for sometime now, some people say that there's no such thing called entity beans in EJB 3.0. 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. I need some clear description about these facts.

Best Answer

The entities managed by EJB3/JPA are not EJBs, they're just POJOs. The entities in EJB 1/2, however, are EJBs, with strict restrictions on their hierarchy.

EJB2-style entities are now completely redundant, they're only supported in EJB3 containers for backwards compatibility.

Related Topic