Question: I know that entityManager.find() method can be used to fetch a row with the primary key.

But I have a requirement to define a common find method which accepts a map having the where clause conditions. In the map, key will be the column name and value will be the column name value of the where clause. This method should return the list of selected rows.

Can some one help me out?

Answer: 
find fetches the row respect to the primary key.Now as you want
"*common find method which accepts a map having the where clause conditions. In the map, key will be the column name and value will be the column name value of the where clause. This method should return the list of selected rows"*
for this you have to go for CriteriaQuery like this :

The following simple Criteria query returns all instances of the Pet entity in the data source:

```
EntityManager em = ...;
CriteriaBuilder cb = em.getCriteriaBuilder();
CriteriaQuery<Pet> cq = cb.createQuery(Pet.class);
Root<Pet> pet = cq.from(Pet.class);
cq.select(pet);
TypedQuery<Pet> q = em.createQuery(cq);
List<Pet> allPets = q.getResultList();

```

The equivalent JPQL query is:

```
SELECT p FROM Pet p

```

Moreover i will advise you to go for annotation based mapping in your entities & look for setter & getter for the methods.In that design also you can have customized method by java logic for this go [here](http://en.wikibooks.org/wiki/Java_Persistence/Relationships) to read.
Following might be overkill, but is a fairly generic way to approach it utilizing the criteriaBuilder. While I can't paste the code here (work) I created an abstract BaseFilter<Entity> class.

The easy part is then having the implementing objects provide getXX, setXX properties. A getPredicates() was then added to return an ArrayList of predicates that the abstract BaseDAO could then invoke to perform the query. 

We worked specifically with the getXX and setXXX so we could reference the elements via eg, get(Entity1\_.childObject).get(ChildObject\_.grandChildObject) to assist in refactoring. JPA also supports it via string name so you could implement the getPredicates with that. 

JPA requires the actual Entity.class reference in their calls it was a bit of fun trying to obtain it. Eventually a google search turned it up.