File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes EJB and other Java EE Technologies and the fly likes Multiple column selection using EJB-QL Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login

Win a copy of Head First Android this week in the Android forum!
JavaRanch » Java Forums » Java » EJB and other Java EE Technologies
Bookmark "Multiple column selection using EJB-QL " Watch "Multiple column selection using EJB-QL " New topic

Multiple column selection using EJB-QL

Vivek Mathur

Joined: Jun 29, 2007
Posts: 25

I want to select multiple columns through EJB-QL, but whenever i write that
it gives an exception saying it was expecting 'from' instead of ','.
EJB-QL is like as follows:

select m1.code, m1.text from DROP_VALUE m1 where lang=?1

Home method for this is having return type as 'Collection'

Can you please tell can we select multiple columns at a time or not throgh EJB-QL and if yes, then how todo that.
Jeanne Boyarsky
author & internet detective

Joined: May 26, 2003
Posts: 32312

This thread implies that it should be possible.

I haven't tried it though and would recommend just returning m1 (the whole entity) if you having problems.

[OCA 8 book] [Blog] [JavaRanch FAQ] [How To Ask Questions The Smart Way] [Book Promos]
Blogging on Certs: SCEA Part 1, Part 2 & 3, Core Spring 3, OCAJP, OCPJP beta, TOGAF part 1 and part 2
I agree. Here's the link:
subject: Multiple column selection using EJB-QL
It's not a secret anymore!