My first CMP entity bean and I have some questions.

I was wondering if it is possible to do a compound search within the O/R
mapping in orion-ejb-jar.xml?

The problem is a field from one table is needed to lookup a field on another
table to get the result.

Example: 

Customer has a field called company.  The company table has a place for company
name.  All PKs are integers.  In the customer table the company is a pk from
the company table.  I want to get all of the customer information and use the
company pk to look up the company name.

How would I have this entity in the orion-ejb-jar.xml file?
table = "ATD_CUSTOMER"
Example 1:
<cmp-field-mapping name="customerID" persistence-name="CUSTOMER_ID"
persistence-type="NUMBER" />
<cmp-field-mapping name="firstName" persistence-name="FIRST_NAME"
persistence-type="VARCHAR2" />
<cmp-field-mapping name="lastName" persistence-name="LAST_NAME"
persistence-type="VARCHAR2" />
<cmp-field-mapping name="company" persistence-name="ATD_COMPANY.NAME"
persistence-type="VARCHAR2" />


Example 2:
<cmp-field-mapping name="customerID" persistence-name="CUSTOMER_ID"
persistence-type="NUMBER" />
<cmp-field-mapping name="firstName" persistence-name="FIRST_NAME"
persistence-type="VARCHAR2" />
<cmp-field-mapping name="lastName" persistence-name="LAST_NAME"
persistence-type="VARCHAR2" />
<cmp-field-mapping name="company" persistence-name="COMPANY_ID"
persistence-type="NUMBER" />
<cmp-field-mapping name="companyName" persistence-name="ATD_COMPANY.NAME"
persistence-type="VARCHAR2" />

=====
Jon Bricker

"You should never settle for the lesser of two Weasels."

__________________________________________________
Do You Yahoo!?
Great stuff seeking new owners in Yahoo! Auctions! 
http://auctions.yahoo.com

Reply via email to