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

Entity bean

 
Greenhorn
Posts: 26
  • Mark post as helpful
  • send pies
  • 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
  • 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???

    Bookmark Topic Watch Topic
  • New Topic