• Post Reply Bookmark Topic Watch Topic
  • New Topic

Hibernate 5 cannot build a subquery with correlate method in Criteria API?  RSS feed

 
Himai Minh
Ranch Hand
Posts: 1539
9
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi, I am trying with ToyAppForJPA from Enthuware. I tried to build a criteria query like this:



JPA CB Query Output -
[TargetError : Sourced file: inline evaluation of: ``import com.enthu.ejbplus.*;import java.util.*;import javax.persistence.*;import  . . . '' : Typed variable declaration : Method Invocation em.createQuery : at Line: 13 : in file: inline evaluation of: ``import com.enthu.ejbplus.*;import java.util.*;import javax.persistence.*;import  . . . '' : em .createQuery ( c )

Target exception: java.lang.IllegalArgumentException: org.hibernate.hql.internal.ast.QuerySyntaxException: unexpected token: ) near line 1, column 197 [select generatedAlias0 from salesapp.CustOrder as generatedAlias0 inner join generatedAlias0.lineItems as generatedAlias1 where generatedAlias1.quantity=(select max(generatedAlias1.quantity) from )]
]

When Hibernate tries to build the corresponding JPQL, the from expression is missing.
Did I do anything wrong?
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!