• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

alternate way for using max in ejbql

 
dhriti joshi
Ranch Hand
Posts: 82
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 382
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
Sujit udhane
Greenhorn
Posts: 4
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 1066
  • 0
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
thanks Sujit,
That's an old article but very informative about EJB-QL for EJB2.1 by RMH
 
It is sorta covered in the JavaRanch Style Guide.
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic