I found following paragraphs in the book 'Enterprise
Java Beans' by Monson-Haefel -
An undefined primary key allows the deployer to choose a system-specific key at deployment time.
For example, An object database, uses a completely different mechanism for indexing objects, to which a primary key may not map well.
To facilitate the use of undefined primary keys, the CMP bean class and its interfaces use the Object type to identify the primary key. The findByPrimaryKey() method defined in the local and remote home interfaces must also use an Object type. The deployment descriptor defines its primary key type as java.lang.Object and does not define any <prim-key-field> elements it's not possible to construct an undefined primary key to use in a find method if you don't know its type.
Now my question is: the developer does not define
EJB QL for findByPrimaryKey() method. It is done by the container automatically.
So in case of undefined primary key, how does the container provide the implemenation for findByPrimaryKey() if the primary key itself is undefined?
Moreover, findByPrimaryKey() method has to be present in home interface of an entity bean, so who provides it's implementation? how does the container map the Object type primary key to the underlying data source specific primary key?
