What i want is to send Mobile number to the database and fetch Customer object. i debug following code and saw null customer object returned. Any help?
public Customer unSuccessfulLoginAttempts(String mobileNumber) { log.info("<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<| Unsuccessful Logging Attempts Repository Starting|>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>> {}" ,mobileNumber ); Session session = entityManager.unwrap(Session.class); Criteria criteria = session.createCriteria(Customer.class,"c"); Criterion mobile = Restrictions.eq("c.phone1",mobileNumber); criteria.add(Restrictions.eq("u.phone1", mobileNumber)); return (Customer) criteria.list(); }