- Overview
- The javax.ejb Package for Entity Beans
- Entity Bean Types
- Remote Versus Local Interfaces
- BMP Entity Bean Lifecycle
- Specifying a BMP Entity Bean
- Implementing a BMP Entity Bean
- Configuring and Deploying a BMP Entity Bean
- Client's View
- Session Beans Revisited
- Patterns and Idioms
- Gotchas
- Summary
- Q&A
- Exercises
Q&A
Q: What do Entity beans represent?
A: Entity beans represent persistent data that can be accessed and shared by many clients over time.
Q: Why are local interfaces preferable to remote interfaces for Entity beans?
A: Local interfaces perform better because there is no network traffic when calling a bean through its local interface, and there is also no need to clone serializable objects.
Q: What are the two types of Entity beans?
A: The two types of Entity beans are BMP and CMP.
Q: How does a BMP Entity bean know what its primary key is?
A: It can be passed as an argument of ejbCreate(), it could be generated by the RDBMS, it could be generated by some other bean, or it might be generated as a pseudo-random value using an algorithm that guarantees uniqueness.
Q: Which two methods should the primary key class implement?
A: The primary key class should implement the hashCode() and equals() methods.