• Post Reply Bookmark Topic Watch Topic
  • New Topic

Find method - Where Clause  RSS feed

 
Samuel Huang
Greenhorn
Posts: 8
  • Mark post as helpful
  • send pies
  • 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

 
Tim Holloway
Bartender
Posts: 18663
71
Android Eclipse IDE Linux
  • Mark post as helpful
  • send pies
  • 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.
 
hhoang
Greenhorn
Posts: 2
  • Mark post as helpful
  • send pies
  • 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
  • Quote
  • Report post to moderator
Hi Tim and HHoang,
Thank you for your help.
Samuel
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!