Home > Articles > Programming > Java

  • Print
  • + Share This
This chapter is from the book

This chapter is from the book


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.

  • + Share This
  • 🔖 Save To Your Account