@Override
public Usuario iniciarSesion(Usuario us){
Usuario usuario = null;
String consulta;
try {
consulta = "FROM usuario u WHERE u.usuario = ?1 and u.password =?2";
Query query = em.createQuery(consulta);
query.setParameter(1, us.getUsuario());
query.setParameter(2, us.getPassword());
List<Usuario> lista = query.getResultList();
if (!lista.isEmpty()) {
usuario = lista.get(0);
}
} catch (Exception e) {
throw e;
}
return usuario;
I get the following error
Caused by: Exception [EclipseLink-0] (Eclipse Persistence Services - 2.5.0.v20130507-3faac2b): org.eclipse.persistence.exceptions.JPQLException Exception Description: Problem compiling [FROM user u WHERE u.user =? 1 and u.password =? 2]. [5, 12] The abstract schema type 'user' is unknown. [21, 30] The state field path 'u.user' can not be resolved to a valid type. [40, 50] The state field path 'u.password' can not be resolved to a valid type.