• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Tim Cooke
  • paul wheaton
  • Ron McLeod
  • Jeanne Boyarsky
Sheriffs:
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Roland Mueller
Bartenders:

Question on JPQL...

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
I need help in formulating a JPQL query in this situation:

1. I have Customer and Order entities and I want all the Customers who have ordered something. I am thinking:

select c from Customer c, In(c.orders) o

Is that correct? Would the query be different in EJBQL and JPQL for this situation?

2. What if I want all the customers who have an order that is larger than say 100$?

select c from Customer c, In(c.orders) o where o.amt>100

Any ideas?

Also, can someone point me to some resource that contains differences between EJBQL and JPQL?? I am really confused with both.
 
ranger
Posts: 17347
11
Mac IntelliJ IDE Spring
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
How about we move this to the more appropriate ORM forum, which covers JPA questions. Instead of it being linked from another thread you created in the ORM forum.

Mark
 
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Ann,

Hope this article helps you -> JPQL
reply
    Bookmark Topic Watch Topic
  • New Topic