File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes EJB and Other Java EE Technologies and the fly likes Find method - Where Clause Big Moose Saloon
  Search | Java FAQ | Recent Topics
Register / Login
JavaRanch » Java Forums » Java » EJB and Other Java EE Technologies
Reply Bookmark "Find method - Where Clause" Watch "Find method - Where Clause" New topic
Author

Find method - Where Clause

Samuel Huang
Greenhorn

Joined: Oct 29, 2001
Posts: 8
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
Saloon Keeper

Joined: Jun 25, 2001
Posts: 12513

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.


One of the most odious afflictions that Business has inflicted on the modern English language is "pro-active". Most of the time it's simply redundantly used in place of the simple old word "active". And a good deal of the rest of the time it means "You're not overworked enough yet, so go out and find more!"
hhoang
Greenhorn

Joined: Aug 10, 2001
Posts: 2
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

Joined: Oct 29, 2001
Posts: 8
Hi Tim and HHoang,
Thank you for your help.
Samuel
 
IntelliJ Java IDE
 
subject: Find method - Where Clause
 
Threads others viewed
Exception while firing the join queries
Driving table in sql
JDBC Newbie
Need help on creating tables for a simple scenario
how to get details without querying full table ResultSetMetaData
MyEclipse, The Clear Choice

cast iron skillet 49er

more from paul wheaton's glorious empire of web junk: cast iron skillet diatomaceous earth rocket mass heater sepp holzer raised garden beds raising chickens lawn care CFL flea control missoula heat permaculture