Re: EJB CMP suggestion

2000-05-09 Thread Karl Avedal

Hello Jen,

To find out how to be able to specify joins or any SQL in custom finders, read:

http://www.orionserver.com/docs/orion-ejb-jar.xml.html

Search for query and look at the partial attribute.

What you want is already possible, without changing the code of your beans.

Regards,
Karl Avedal

Jen Hsien Huang wrote:

 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.





RE: EJB CMP suggestion

2000-05-09 Thread Conrad Chan

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.