What are the differences of Container Managed Persitence 1.1 and 2.0

Alessandro A. Garbagnati

The main difference is that in EJB 2.0, the persistence manager is responsible for mapping the entity bean to the database based on the newly introduced abstract persistence schema. In other words, you can say that the persistence manager handles persistence of your CMP entity beans at runtime.
Plus, thanks to the EJB Query Language, the persistence manager is also responsible for implementing and executing find methods based on it.

In the previous CMP EJB 1.1, is the developer that must declare the bean class' persistent fields as either Java primitive or serializable types, providing getters and setters for all of them.

In CMP EJB 2.0, its persistent fields are not defined directly in the bean class, thanks to the new abstract persistent schema.
This schema has been developed to allow the bean provider to declare the persistent fields (and bean relationships, eventually) indirectly.

An interesting example can be found at Read all about EJB 2.0.
Comment and Contribute

 

 

 

 

 


(Maximum characters: 1200). You have 1200 characters left.

 

 

About | Sitemap | Contact