How about having your Product company finder query to be
"SELECT * FROM Product WHERE Product.company = (SELECT Company.id FROM Company
WHERE Company.name LIKE ?"
I understand that this query may not be identical to the query you provided. But my
point is it is possible.
Conrad
-----Original Message-----
From: Jen Hsien Huang [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 09, 2000 3:38 AM
To: Orion-Interest
Subject: EJB CMP suggestion
EJB CMP feature is fantasy. But it's use less because I cant do a simple joint on it,
so I wonder the benifit of CMP is just a dream. for example I have two EJB , Company
and Product, a Product can use Company as it CMP field , but if I want a finder method
search the Product by the Company name, that's impossible.
So why not define a CMP finder syntax can do a simple joint ? for example
public Collection findByCompanyName(String value) throws RemoteException,
FinderException;
public static final String findByCompanyName_query = "$company.name LIKE $1";
this will generate a SQL call that joint tables of Product and Company. ex
"SELECT * from Product , Company where Company.id = Product.company and Company.name
LIKE ? "
I think this will make CMP more useful.