• 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
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Junilu Lacar
Sheriffs:
  • Rob Spoor
  • Liutauras Vilda
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Piet Souris
  • Tim Holloway
  • Jj Roberts
  • Stephan van Hulst
Bartenders:
  • Himai Minh
  • Carey Brown
  • Frits Walraven

Entity bean

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I just started with the Entity bean....
Can anyone tell me regardig the finder methods that is the
findByPrimary key(object) is declared in the home interface....
So how the client get that???
 
Greenhorn
Posts: 6
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi
The finder Queries are used to find already existing data in the Persistent store.
If u use CMP entity beans, u don't need to implement any finder methods.
u have to specify them in the Home interface of the corresponding Entity bean and the appropriate EJB Query in the ejb-jar.xml file.
The container will implement the method for u.
But u should define an abstract method in the Entity bean class with return type as the primary key class or collection of such.
In case if u use BMP, then u should provide the implementation for the finder methods ur own data access logic.
Here again the return type should be primary key class or a collection of such.
Actually u return the primary key class to the container and the container in turn will create the required EJB objects and send it back to the client.
Remember, u can't access the EJB directly.
Also every entity bean should provide atleast one finder method called findByPrimarykey(Object) whether its CMP/BMP.
I hope u r a bit clear by now.
If u have any doubts, please do mail me at sathishkk@planetasia.com
Thanx
Sathish

Originally posted by ALaxmi Shankaran:
I just started with the Entity bean....
Can anyone tell me regardig the finder methods that is the
findByPrimary key(object) is declared in the home interface....
So how the client get that???

 
reply
    Bookmark Topic Watch Topic
  • New Topic