Win a copy of Machine Learning Systems: Designs that scale this week in the Scala forum
or Xamarin in Action: Creating native cross-platform mobile apps in the Android forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

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

 
Ranch Hand
Posts: 1684
12
  • 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?

 
This parrot is no more. It has ceased to be. Now it's a tiny ad:
Rocket Oven Kickstarter - from the trailboss
https://coderanch.com/t/695773/Rocket-Oven-Kickstarter-trailboss
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!