• 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Liutauras Vilda
  • Campbell Ritchie
  • Tim Cooke
  • Bear Bibeault
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Knute Snortum
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Ganesh Patekar
  • Stephan van Hulst
  • Pete Letkeman
  • Carey Brown
Bartenders:
  • Tim Holloway
  • Ron McLeod
  • Vijitha Kumara

Question on JPQL...  RSS feed

 
Ranch Hand
Posts: 48
  • Mark post as helpful
  • send pies
  • 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
Sheriff
Posts: 17314
11
IntelliJ IDE Mac Spring
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hi Ann,

Hope this article helps you -> JPQL
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!