This week's giveaway is in the EJB and other Java EE Technologies forum.
We're giving away four copies of EJB 3 in Action and have Debu Panda, Reza Rahman, Ryan Cuprak, and Michael Remijan on-line!
See this thread for details.
The moose likes Object Relational Mapping and the fly likes Conditions for dependent entites on fetching? Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Databases » Object Relational Mapping
Bookmark "Conditions for dependent entites on fetching?" Watch "Conditions for dependent entites on fetching?" New topic
Author

Conditions for dependent entites on fetching?

Johann Dobbins
Ranch Hand

Joined: Oct 16, 2008
Posts: 62
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 c.id = ?id

gives a toplink exception, "unexpected token: n"
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Conditions for dependent entites on fetching?
 
Similar Threads
COLLECTION_VALUED_PATH Exception
Java Persistence API
Problems using GenerationType.IDENTITY for in-memory databases
Spring/JPA/TopLink 11g extensions
HTTP Status 403 - Access to the requested resource has been denied