Exercises

To extend your knowledge of the subjects covered today, try the following exercises.

1:Design a student bean-managed persistence bean. The bean consists of the persistent fields studentId, firstName, lastName, and address. Draw a class diagram that shows the entity bean class and its interfaces along with their methods. In addition, provide a method that calculates the total number of students.
2:Design an order container-managed persistence bean. The bean consists of persistent fields orderId, studentId, orderDate, and amount. Draw a class diagram that shows the entity bean class and its interfaces along with their methods. In addition, provide a method that calculates the total amount for all orders.

Get Sams Teach Yourself EJB in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.