anjeev,
What version of Oracle9iAS/OC4J are you using ? OC4J supports composite primary
key mapping since 1.0.2.2.

Here is a sample mapping for composite primary key mapping to be used in the
vendor specific deployment descriptor:

<primkey-mapping>
    <cmp-field-mapping>
     <fields>
      <cmp-field-mapping name="areaID" persistence-name="areaid" />
      <cmp-field-mapping name="questionID" persistence-name="questionid" />
     </fields>
    </cmp-field-mapping>
   </primkey-mapping>

For faster response Oracle9iAS questions you can post your questions in
http://www.oracle.com/forums/forum.jsp?id=486963

regards
Debu

Sanjeev Verma wrote:

> Hi all
>
> I have a little query for someone who has worked with Oracle9iAS. I think it
> should also be valid for someone with Orion experience, as Orion forms the
> heart of Oracle9iAS.
>
> The question is: how do I declare the "<primkey-mapping>" for a cmp entity
> bean inside orion-ejb-jar.xml, which has a compound primary key (a user
> defined class).
>
> The documentation of the Oracle9iAS server speaks only about the simple case
> of a single column being the primary key, in which case the
> <entity-deployment> tag is defined as below. The problem is that the DTD of
> orion-ejb-jar.xml defines the <entity-deployment> element as having "zero or
> one" <primkey-mapping> elements, and the <primkey-mapping> tag can have one
> and only one <cmp-field-mapping>
>
>                 <entity-deployment name="EmployeeBean"
> location="cmpapp/EmployeeBean" table="EMP" data-source="jdbc/OracleDS">
>                         <primkey-mapping>
>                                 <cmp-field-mapping name="empNo"
> persistence-name="EMPNO" />
>                         </primkey-mapping>
>                         <cmp-field-mapping name="empName"
> persistence-name="ENAME" />
>                         <cmp-field-mapping name="salary"
> persistence-name="SAL" />
>                         <finder-method query="$empName = $1">
>                                 <method>
>                                         <ejb-name>EmployeeBean</ejb-name>
>
> <method-name>findByName</method-name>
>                                         <method-params>
>
> <method-param>java.lang.String</method-param>
>                                         </method-params>
>                                 </method>
>                         </finder-method>
>                         <finder-method query="">
>                                 <method>
>                                         <ejb-name>EmployeeBean</ejb-name>
>                                         <method-name>findAll</method-name>
>                                         <method-params></method-params>
>                                 </method>
>                         </finder-method>
>                 </entity-deployment>
>
> Any help will be appreciated.
>
> Regards
> Sanjeev
>
> ===========================================================================
> To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
> of the message "signoff EJB-INTEREST".  For general help, send email to
> [EMAIL PROTECTED] and include in the body of the message "help".

===========================================================================
To unsubscribe, send email to [EMAIL PROTECTED] and include in the body
of the message "signoff EJB-INTEREST".  For general help, send email to
[EMAIL PROTECTED] and include in the body of the message "help".

Reply via email to