please convert the sql in hql
SQL Statement : s*elect username from useraccout where email = "parameter value"*
More description:
while running the code i am getting this error:
public List dispUser(String email){
Query query = em.createQuery("SELECT u.username FROM Useraccout u WHERE u.email=:email)");
query.setParameter(email, email);
List search = query.getResultList();
return search;
}
while running the code i am getting following error
java.lang.IllegalArgumentException: org.hibernate.hql.ast.QuerySyntaxException:
Useraccout is not mapped [SELECT u.username FROM Useraccout u WHERE u.email=:email1)]
at org.hibernate.ejb.AbstractEntityManagerImpl.throwPersistenceException(AbstractEntityManagerImpl.java:624)
at org.hibernate.ejb.AbstractEntityManagerImpl.createQuery(AbstractEntityManagerImpl.java:96)
at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)