>PROBLEM
java.lang.IllegalArgumentException: org.hibernate.QueryException: Unable to resolve path [e.title], unexpected token [e] [select e from br.com.adr.model.entity.security.uni.RoleEntity WHERE e.title = :title]
>SOLUTION
Original code:
String sql = "select e from " + this.entityName + " WHERE e.title = :title";
Query query = em.createQuery(sql, RoleEntity.class);
query.setParameter("title", title);
Fixing the code:
Missing the 'e' entity alias:
String sql = "select e from " + this.entityName + " e WHERE e.title = :title";
>ENV
Windows 10
JSF 2.2
WildFly 21
No comments:
Post a Comment