Hi Rahul,
You can take alook at section 9.4.11 of EJB 2.0 proposed final draft.
Spec says :
"The Bean Provider must not expose the dependent object classes or the
persistent Collection classes
that are used in container managed relationships through the remote
interface of the bean...."
This is because the implementation of Collection class is given by
Persistence Manager, and PM may be doing certain processing whenever any
method is called on the Collection.
"Although dependent object classes cannot be exposed in the remote
interface, the Bean Provider can use
the accessor methods to obtain instances of these persistent classes
(including the collection classes that
correspond to relationships), and can copy data to or from these instances
to instances of the classes that
are exposed in the remote interface."
This provides you a way to expose the values in the Collection. This is
explained in the example in section 9.4.13 of EJB 2.0 proposed final draft.
Regards,
Hemant
Server Team,
Pramati Technologies
www.pramati.com
----- Original Message -----
From: "Hemant Khandelwal" <[EMAIL PROTECTED]>
To: "A mailing list for Enterprise JavaBeans development"
<[EMAIL PROTECTED]>
Sent: Tuesday, February 06, 2001 10:43 AM
Subject: Re: exception when seaching child records in an entity bean
Firstly, a getter method should be declared to return non-void value.
If you are doing something like this in the Remote Interface
public Collection getSolutionds() throws
RemoteException;
is not allowed.
The method will return a Collection whose implementation is provided by the
Persistence Manager. This Collection should not be exposed in a
RemoteInterface. i.e. accessor method ("get" and "set") for
Collection-valued cmr-fields should not be exposed in Remote Interface.
See section 9.4.6 and 9.4.8 of EJB 2.0, Proposed Final Draft.
Hemant
ServerTeam,
Pramati Technologies
www.pramati.com
----- Original Message -----
From: "SoftFrance MOODAD Shadi" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Monday, February 05, 2001 8:02 PM
Subject: exception when seaching child records in an entity bean
Hi every body
My problem:
I'm trying to find the child record related to an entity in a
one-to-many relationship(Solution-->SolutionDetail)
I have the following method in the Solution remoteInterface
public void getSolutionds(Collection solutionds) throws
RemoteException;
and i have the folowing relationship descriptor in the ejb-jar.xml
<ejb-relation>
<ejb-relation-name>SolutionDetail</ejb-relation-name>
<ejb-relationship-role>
<ejb-relationship-role-name>solutiond-belongto-solutionh</ejb-relationship-r
ole-name>
<multiplicity>many</multiplicity>
<role-source>
<ejb-name>Solutiond</ejb-name>
</role-source>
<cmr-field>
<cmr-field-name>solutionh</cmr-field-name>
</cmr-field>
</ejb-relationship-role>
<ejb-relationship-role>
<ejb-relationship-role-name>solutionh-has-solutiond</ejb-relationship-role-n
ame>
<multiplicity>one</multiplicity>
<role-source>
<ejb-name>Solution</ejb-name>
</role-source>
<cmr-field>
<cmr-field-name>solutionds</cmr-field-name>
<cmr-field-type>java.util.Collection</cmr-field-type>
</cmr-field>
</ejb-relationship-role>
</ejb-relation>
the deployment (under beaWebLogic 6.0) succed but if i use that relation
and the the method "mentioned above" i get a run time execution error
java.rmi.MarshalException: error marshalling return; nested exception
is:
java.io.NotSerializableException:
solution.SolutionBean_WebLogic_CMP_RDB
MS_solutionds_Set
java.io.NotSerializableException:
solution.SolutionBean_WebLogic_CMP_RDBMS_solut
ionds_Set
<<no stack trace available>>
thanks a lot for a 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".
===========================================================================
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".