Interview Questions

Can the primary key in the entity bean be a Java primitive type such as int?

EJB Interview Questions and Answers


(Continued from previous question...)

13. Can the primary key in the entity bean be a Java primitive type such as int?

The primary key can’t be a primitive type. Use the primitive wrapper classes, instead. For example, you can use java.lang.Integer as the primary key class, but not int (it has to be a class, not a primitive).

(Continued on next question...)

Other Interview Questions