• 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
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

Find method - Where Clause

 
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Can someone help answer the following question?
For 2 CMP entity beans, Employee and Company(column Com_ID in Employee table references the primary key in Company table), if there is a method in Employee Bean�s home interface:
public java.util.Collection findByCompany(Company company) throws RemoteException, FinderException;
what is the syntax of where clause for this method in the XML descriptor?
Many thanks in advance!
Samuel Huang

 
Saloon Keeper
Posts: 27807
196
Android Eclipse IDE Tomcat Server Redhat Java Linux
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Until EJB2.0 becomes the standard, that will depend on whose EJB server you are using. There's no place in the EJB1.1 ejb-jar.xml file to put it, so a secondary XML file is usually used.
Even the syntax of the finder rule varies widely. In JOnAS, it might be:
WHERE company = ?
But in WebLogic, it would be:
(= company $0)
You'll just have to consult the server docs.
 
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
to see an example of how finder method is implement,
download http://www.myhtg.com/examples.zip

Originally posted by Tim Holloway:
Until EJB2.0 becomes the standard, that will depend on whose EJB server you are using. There's no place in the EJB1.1 ejb-jar.xml file to put it, so a secondary XML file is usually used.
Even the syntax of the finder rule varies widely. In JOnAS, it might be:
WHERE company = ?
But in WebLogic, it would be:
(= company $0)
You'll just have to consult the server docs.


 
Samuel Huang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hi Tim and HHoang,
Thank you for your help.
Samuel
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
reply
    Bookmark Topic Watch Topic
  • New Topic