Simple hql named query that uses a inner join

前端 未结 2 1435
甜味超标
甜味超标 2021-01-03 13:08

I want to do something like this in my domain/entity object :

@Entity
@NamedQueries({
@NamedQuery(name=\"favouriteCats\", query=\"from Cat c inner join on Us         


        
2条回答
  •  有刺的猬
    2021-01-03 13:21

    Case Issue, Right query would be:

    from Cat c inner join on Usercat uc where uc.isfavourtie = true and uc.user = :user
    

    Note : C in Cat is capital, U in Usercat is capital where as c in Usercat is small and f in isfavourite is small.

提交回复
热议问题