this is my named query:
@NamedQuery (name = "User.findOneWithLists", query = "SELECT u FROM User u" + "LEFT JOIN FETCH u.aTemplates" + "LEFT JOIN FETCH u.bTemplates" + "LEFT JOIN FETCH u.bp" + "LEFT JOIN FETCH u.aCredentials "+" LEFT JOIN FETCH u.st WHERE (st.deleted = false) "+" LEFT JOIN FETCH u.bCredentials "+" LEFT JOIN FETCH u.cl "+" WHERE u.id =: id ")
My problem is that I get an error message when starting the application:
org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: LEFT ....
On the first side there is an annotation
@ManyToOne @JoinColumn(name = "st_user") private User user;
Any idea how I can handle this where clause?
SQL, left join where. , SQL, , , where , . . "--".
left join
where
@NamedQuery( name = "findOneWithLists", query = "from Table t left join User u where u.id= :id" )
Hibernate with, JPA 2.1.
with
:
SELECT u FROM User u ... LEFT JOIN u.st WITH st.deleted = false
LEFT JOIN FETCH u.cl with u.id= :id, , u.ui = :id where.
LEFT JOIN FETCH u.cl with u.id= :id
u.ui = :id
LEFT JOIN FETCH u.st st.deleted = false`
, .