I am using EJB3 with JPA. In that I want to use the find() method. My question is that, can I use find method to find all the records on the non primary key basis ie; my search condition is not the primary key.
The find() method only works with primary keys. You can use the createQuery() method to pass in random queries though using any where clause. createNamedQuery() is generally better because it can prepare/cache the query for reuse.