• Post Reply Bookmark Topic Watch Topic
  • New Topic

select field, count(field)... in EJB-QL

 
Matt Kim
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
How can I accomplish an SQL query similar to:

"select field, count(field) from
table where..."

(the "field, count(field)" is where I'm having difficulties)

Is there a solution in either EJB-QL 2.0 (which I doubt) or JBOSS-QL?

I've read a suggestion to create a seperate JDBC connection using a session bean and running the SQL query, but I'd like to keep everything in EJBs.

Thanks in advance!
Matt
 
Matt Kim
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Can anyone help?
 
Maulin Vasavada
Ranch Hand
Posts: 1873
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi Matt,

The count is a aggregate function which is not supported in EJB QL2.0 (but its there in EJB QL 2.1.

I am not sure if its there in JBoss QL.

I would go with that separate JDBC query thing.

Thanks
Maulin
 
Matt Kim
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Maulin, I guess that's what I'll have to do.
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!