Win a copy of Murach's Python Programming this week in the Jython/Python forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

Question on JPQL...  RSS feed

 
Ann Basso
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.
 
Mark Spritzler
ranger
Sheriff
Posts: 17309
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
 
Shailesh Kini
Ranch Hand
Posts: 153
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Ann,

Hope this article helps you -> JPQL
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!