static List < User > onQueryByEmail ( final EntityManager em , final User user ) { // Query by parameter (fetch user by email id) String query = "Select u from User u where u.emailId =?1" ; logger . info ( "" ) ; logger . info ( "" ) ; logger . info ( query ) ; System . out . println ( "#######################Querying##########################################" ) ; // find by named parameter(e.g. email) List < User > fetchedUsers = findByEmail ( em , query , user . getEmailId ( ) ) ; return fetchedUsers ; }
on query with user email id