Q1: | What do Entity beans represent? |
A1: | Entity beans represent persistent data that can be accessed and shared by many clients over time. |
Q2: | What are the two types of Entity beans? |
A2: | The two types of Entity beans are BMP and CMP. |
Q3: | Why are local interfaces preferable to remote interfaces for Entity beans? |
A3: | 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. They are also the basis for CMP. |
Q4: | How does a BMP Entity bean know what its primary key is? |
A4: | 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. |
Q5: | Which two methods should the primary key class implement? |
A5: | The primary key class should implement the hashCode() and equals() methods. |
3.142.166.31