Hi,
  Let us assume a fragment of domain model
  public class Student {
   private Map<Course, Semester> enrollment;
  }
  The following query (that involves a predicate on the keys of the map)
will return the Students who enrolled for a course named ':name':

           "select s from Student s JOIN s.enrollment e where
KEY(e).name=:name";



Pmoran wrote:
> 
> How could one query a contained map object? 
> Basically, I wish to select the objects in the map that have a key equal
> to some value and then actually perform an action on the value portion of
> the key-value map pair.
> Ideally I would like to use JPQL but I don't think I get this sort of
> access. I could write it in SQL but would rather not. 
> Any suggestions?
> 
> 
> 


-----
Pinaki 
-- 
View this message in context: 
http://n2.nabble.com/Querying-a-map-object-tp3447125p3448743.html
Sent from the OpenJPA Users mailing list archive at Nabble.com.

Reply via email to