• 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:
  • Campbell Ritchie
  • Ron McLeod
  • Rob Spoor
  • Tim Cooke
  • Junilu Lacar
Sheriffs:
  • Henry Wong
  • Liutauras Vilda
  • Jeanne Boyarsky
Saloon Keepers:
  • Jesse Silverman
  • Tim Holloway
  • Stephan van Hulst
  • Tim Moores
  • Carey Brown
Bartenders:
  • Al Hobbs
  • Mikalai Zaikin
  • Piet Souris

find & Select

 
Ranch Hand
Posts: 42
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
1. What are the differernce between find and select methods & At what circumstances we use them
2. I have used the EJB-QL
SELECT COUNT(x.messageId) FROM t_message AS x WHERE x.forumId=?1
for the find method
public Integer findNofOfReplays (Integer forumId) throws FinderException;
But I got the following

Bean: MessageLocalEJB
Method: java.lang.Integer findNofOfReplays(java.lang.Integer)
EJBQL: SELECT COUNT(x.messageId) FROM t_message AS x WHERE x.forumId=?1
Error: JDO75333: Invalid return type 'java.lang.Integer' for finder method.

I tried the same query in EJB Select and it's worked


Thanks
Suneesh
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Suneesh,
As of EJB Spec, find methods (ejbFind...()) can return only Primary Key object or a collection of Primary Keys....

Where as ejbSelect can have return type as any value, which is in your case an integer...
reply
    Bookmark Topic Watch Topic
  • New Topic