• 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 wheaton
  • Ron McLeod
  • Devaka Cooray
Sheriffs:
  • Jeanne Boyarsky
  • Liutauras Vilda
  • Paul Clapham
Saloon Keepers:
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:

How do I run findByPrimaryKey method with CMP 2.0?

 
Ranch Hand
Posts: 379
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi, I'm deploying a local entity bean. I know that I can run any finder method with CMP 2.x by declaring it as abtract in the bean implementation class and then by defining the query in the deployment descriptor. My question is: how do I run the findByPrimaryKey method? Shall I write a query element in the dd? How do I execute it from the client?
Regards,
Marco
 
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi,
Here is a complete and basic tutorial on ejb ql -
http://otn.oracle.com/sample_code/tutorials/fbs/eql/toc.htm
Sujatha.
 
Ranch Hand
Posts: 2713
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
The Container provides an implementation of ejbFindByPrimaryKey() for each CMP Bean without additional work on the part of the Bean Developer. All you have to do (and are required to do) is include an ejbFindByPrimaryKey method in your CMP's local home or remote home interface. This of course is assuming you got all the CMP deployment descriptor jazz correct.
To use the findByPrimaryKey method you just need to lookup the home interface and call findByPrimaryKey(). It would look similar to the following (ExampleHome and Example are the local home and local interfaces the the ejb)...
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic