Presentation is loading. Please wait.

Presentation is loading. Please wait.

Container Managed Persistence. General Guidelines Home and Remote interfaces are implemented the same as for bean managed persistence Entity Bean class.

Similar presentations


Presentation on theme: "Container Managed Persistence. General Guidelines Home and Remote interfaces are implemented the same as for bean managed persistence Entity Bean class."— Presentation transcript:

1 Container Managed Persistence

2 General Guidelines Home and Remote interfaces are implemented the same as for bean managed persistence Entity Bean class contains no database access code Application Deployment Tool generates database access statements  Specify container managed fields when you run the ADT

3 Rules for Container Managed Fields Must be one of the following types  Java primitive  Java serializable class  Reference of a home interface  Reference of a remote interface Must be ‘public’ and not ‘transient’ One field selected as the primary key (using the ADT)

4 Implementing Interfaces Still have to follow the rules for implementing methods required by the interfaces.  Some methods will be empty  EJBLoad() & EJBStore()  Container implements the code  Only need to add stuff to process data if required by the application.  EJBCreate()  Make your field assignments  Container makes the datbase call once the bean is created

5 Implementing Interfaces (cont) findByPrimaryKey()  Completely implemented in the container findByDescription() and findInRange()  Mostly implemented  User adds WHERE clause during deployment (using the ADT).

6 Here’s a link to Java’s example of how to do it using the J2EE RI…. http://developer.java.sun.com/developer/onlineTraining/… EJBIntro/exercises/EntityBean/index.html


Download ppt "Container Managed Persistence. General Guidelines Home and Remote interfaces are implemented the same as for bean managed persistence Entity Bean class."

Similar presentations


Ads by Google