Win a copy of Terraform in Action this week in the Cloud forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Tim Cooke
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
Sheriffs:
  • Jeanne Boyarsky
  • Rob Spoor
  • Bear Bibeault
Saloon Keepers:
  • Jesse Silverman
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
Bartenders:
  • Piet Souris
  • Al Hobbs
  • salvin francis

newbie:select method problem

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
hi,i'm a newbie of ejb
now i wanna select out multi fields just like
the traditional select query:
select field1,field4,field7 from table where.............
i looked it up by google
but i found all the samples r like
SELECT t.fieldX FROM table t (one field)
or
SELECT t FROM table t (all fields)
so,in ejb,how can i select out some of the fields by ejb select method?
thank in advance
 
Greenhorn
Posts: 10
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
You can not do this using EJB QL since every select query corresponds to a ejbSelect<METHOD>() you define in the entity bean and the return parameter of the ejbSelect<METHOD>() corresponds to the SELECT <FIELD> of the corresponding EJB QL statement.
The best you can do is select all the fields.
Cheers.
 
Consider Paul's rocket mass heater.
reply
    Bookmark Topic Watch Topic
  • New Topic