I get a error when I createQuery:
'from' unexpected
My code is below:
@Override
public Admin findByAdmin(Admin admin) {
return (Admin) sessionFactory.getCurrentSession().
createQuery("from Admin where admin_name=? and pwd=?").
setParameter(0, admin.getAdminName()).
setParameter(1, admin.getAdminPwd()).
uniqueResult();
}
I'm new to this but had the same error. What fixed things was adding the Hibernate facet under Project Structure - Facets.
Right click on
Your Project
--->
Framework support
:
check mark on "Hibernate"
Press OK.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With