Win a copy of Testing JavaScript Applications this week in the HTML Pages with CSS and JavaScript 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Bear Bibeault
  • Ron McLeod
  • Jeanne Boyarsky
  • Paul Clapham
Sheriffs:
  • Tim Cooke
  • Liutauras Vilda
  • Junilu Lacar
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • fred rosenberger
  • salvin francis
Bartenders:
  • Piet Souris
  • Frits Walraven
  • Carey Brown

findbyprimarykey doubt

 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hello friends,
Can ejbFindByPrimaryKey return object of anyother type other than String.
Can i write
public Enumeration ejbFindByPrimaryKey(String pk) instead of
public String ejbFindByPrimaryKey(String pk).
when i write public Enumeration ejbFindByPrimaryKey(String pk) in my code, when i generate the jar file it gives me an error saying findbyprimarykey is not defined in home interface even though i had defined it...
thanks in advance
Jyothi
 
Ranch Hand
Posts: 1871
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
jyothi,
The Ejb spec 1.1 defines single object finders and Multi Object finders. This is defined in page 114 of the ejb specification. The return type of an finder method defined in the Home interface is a remote reference of the entity bean and that of a multi finder is a Collection/Enumeration of remote references.
Now the return type of a single finder in the Ejb is the Primary Key and that of a multi finder is a Collection/Enumeration of the Primary Key.
code for single finders from ejb spec

code from ejb spec for multi finders

Hope this helps.
------------------

Mahindrakar
IBM Application Server Forum Moderator
Consultant - Zensar Technologies.
SCJP2 & SCJEA (Part I)
 
Looky! I'm being abducted by space aliens! Me and this tiny ad!
Building a Better World in your Backyard by Paul Wheaton and Shawn Klassen-Koop
https://coderanch.com/wiki/718759/books/Building-World-Backyard-Paul-Wheaton
    Bookmark Topic Watch Topic
  • New Topic