aspose file tools*
The moose likes EJB and other Java EE Technologies and the fly likes alternate way for using max in ejbql Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "alternate way for using max in ejbql" Watch "alternate way for using max in ejbql" New topic
Author

alternate way for using max in ejbql

dhriti joshi
Ranch Hand

Joined: Aug 13, 2002
Posts: 82
I guesss select max is not supported by ejbql.
is there any way to do it,like get the entire collection of field and then find max.
please help.
thanks.
Sadanand Murthy
Ranch Hand

Joined: Nov 26, 2003
Posts: 382
Originally posted by dhriti joshi:
I guesss select max is not supported by ejbql.
is there any way to do it,like get the entire collection of field and then find max.
please help.
thanks.

From what I know EJB-QL doesn't support max. I remember that I'd seen some ejb-ql extensions a while ago; but these will be vendor specific. What I'd do in this situation is use jdbc directly to execute select max... statement. Just make sure that you use jdbc connection pool.


Ever Existing, Ever Conscious, Ever-new Bliss
Sujit udhane
Greenhorn

Joined: Dec 27, 2003
Posts: 4
In EJB2.1 for EjbQl ,
Five aggregate functions can be used in the SELECT clause of a EJB QL statement including: COUNT(), MAX( ), MIN( ), AVG( ) and SUM( ).
Refer the following link , that may prove helpful
http://www.theserverside.com/articles/article.jsp?l=MonsonHaefel-Column5
Vishwa Kumba
Ranch Hand

Joined: Aug 27, 2003
Posts: 1066
thanks Sujit,
That's an old article but very informative about EJB-QL for EJB2.1 by RMH
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: alternate way for using max in ejbql