• 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
  • Paul Clapham
  • Ron McLeod
  • paul wheaton
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Tim Cooke
  • Liutauras Vilda
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • Mikalai Zaikin
  • Himai Minh

About ejb-QL

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
"SELECT OBJECT(a) FROM Order AS o, IN(0.lineitem) l"
and
"SELECT OBJECT(a) FROM Order AS o
question:
1.Is first select results different from second results? If different Why?
From sql, "select * from tableA, tableB".
the result will be "cartesian product" of tableA and tableB.
2.In first ejb-ql, "From Order AS o, IN(o.lineitem) l" , Can Order AS o and IN(o.lineitem)l form carstesian product? if not ,Why?
Thanks!
 
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not use ORDER operator in your EJB-QL statement.
SELECT clause for EJB_QL in EJB2.0 specification looks like
select_clause ::= SELECT [DISTINCT ] { single_valued_path_expression |OBJECT (identification_variable)}
Try to download EJB2.0 specification here: ftp://ftp.java.sun.com/pub/ejb/947q9tbb/ejb-2_0-fr2-spec.pdf
If you need to get ordered records , just use SELECT * FROM tableA statement for reading data to the collection of bean objects (via finder) and after that just sort the result collection.
Regards, Volodymyr Shram
[ April 16, 2003: Message edited by: Volodymyr Shram ]
 
huanran liu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Thanks! but Sorry!
Perhaps I didn't explain my meaning clearly.
My order is an CMP(not "order by" in sql statement).
So the two questions above is still ready to be answered . Thanks!
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic