|
Well..You are not supposed to
provide mapping in (deployment descriptors) for "findByPrimaryKey" method as
it's always required for an Entity EJB and thus container takes care of it
accordingly. Just remove the "finder-method" mapping for "findByPrimaryKey" and
it should work.
Thanks
Zahid.
----- Original Message -----
Sent: Thursday, July 18, 2002 12:32 PM
Subject: Re: orion-ejb-jar.xml file <primkey-mapping> element
problem continution...
Hai Mr.Zahid Iqbal thanks to your response and the
problem was solved. But I am getting another problem in findByPrimaryKey method.
My code is as follows.
<finder-method partial="false" query="select * from
cm_notification_details where $1= $notificationID and
$2=$securityID"> <method>
<ejb-name>NotificationDetails</ejb-name>
<method-name>findByPrimaryKey</method-name>
<method-params>
<method-param>
NotificationDetailsPK </method-param>
</method-params>
</method> </finder-method>
In the above code NotificationDetailsPK is my primary key class it has
composite primary key , that is combination of
notificationID and securityID.
But I am getting javax.ejb.ObjectNotFoundException. Is there any wrong
in my finder-method element. Please tell me any one.
Thanks, Murali.
Zahid Iqbal wrote:
Well...I wonder why you
are using <entity-ref home="NotificationDetails"> tag inside
"<primkey-mapping>"? Remove this tag and use the following modified code
snippet. <primkey-mapping>
<fields> <cmp-field-mapping
name="securityID"
persistence-name="SECURITY_ID"/>
<cmp-field-mapping
name="notificationID"
persistence-name="NOTIFICATION_ID"/>
</fields>
</primkey-mapping> Thanks Zahid.-----
Original Message -----From:
Murali Mohan <[EMAIL PROTECTED]>To: <[EMAIL PROTECTED]>Sent: Wednesday, July 17, 2002 12:03
PMSubject: orion-ejb-jar.xml
file <primkey-mapping> element problem > Hai , > I am getting a problem with
orion-ejb-jar.xml file <primkey-mapping>
> element . I have a table
cm_notification_details with a composite > primary key comprises of SECURITY_ID and
NOTIFICATION_ID. >
securityID and notificationID are corresponding fields in CMP.
> NotificationDetails is the
Home Object reference for JNDI > Lookup.Following is the my <primkey-mapping>
element. >
>
<primkey-mapping> > <cmp-field-mapping> > <fields>
> > <cmp-field-mapping
name="securityID"> > <entity-ref
home="NotificationDetails"> > <cmp-field-mapping
name="securityID" >
persistence-name="cm_notification_details.SECURITY_ID"/>
>
</entity-ref> > </cmp-field-mapping>
> > <cmp-field-mapping
name="notificationID"> > <entity-ref
home="NotificationDetails"> > <cmp-field-mapping
name="notificationID" >
persistence-name="cm_notification_details.NOTIFICATION_ID"/>
>
</entity-ref> > </cmp-field-mapping>
> > </fields>
>
</cmp-field-mapping> > </primkey-mapping> > > It seems ok and in the ejb-jar.xml file also contains what it
needs. > But it is
giving Naing exception. How to solve it Can any one help me?
> > Thanks, > Murali > >
===========================================================================
> 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". >
>
|