File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
Win a copy of Clojure in Action this week in the Clojure forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Conditions for dependent entites on fetching?

Johann Dobbins
Ranch Hand
Posts: 63
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am trying to execute a JPQL query using toplink, where an entity fetches its dependent entities, but would like to filter those entities based on status. Situation is as follows:

Customer class has a set of numbers
Number class has a status which can be 0, or 1

to select a customer with a certain id:

SELECT c FROM Customer c left join fetch c.numbers n WHERE n.status = 0 AND = ?id

gives a toplink exception, "unexpected token: n"
I agree. Here's the link:
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic