Win a copy of Cross-Platform Desktop Applications: Using Node, Electron, and NW.js this week in the JavaScript forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

About ejb-QL  RSS feed

 
huanran liu
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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!
 
Volodymyr Shram
Ranch Hand
Posts: 47
  • Mark post as helpful
  • send pies
  • 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
  • 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!
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!