Yes, thats true. There are two checks.One is compiler and other is runtime. You can typecast to any object and compiler will believe you. but at runtime it will check if the object is indeed what you type casted. Then be ready for class cast exception at runtime.
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cheers Ashwani Kalra Sr. Mem. Dev. Staff Aithent Technologies India www.geocities.com/ashwani_kalra/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: A mailing list for Enterprise JavaBeans development [mailto:[EMAIL PROTECTED]]On Behalf Of Pothula, Satish Kumar Reddy (Cognizant) Sent: Wednesday, December 19, 2001 2:13 PM To: [EMAIL PROTECTED] Subject: Re: EJBObject Conversion!! Hi, We can even type cast the return type of the findByPrimaryKey method to an Enumeration without any compilation errors. Infact i experienced the same. -Satish -----Original Message----- From: Ashwani Kalra [mailto:[EMAIL PROTECTED]] Sent: Wednesday, December 19, 2001 1:59 PM To: [EMAIL PROTECTED] Subject: Re: EJBObject Conversion!! Hi, Only findByPrimaryKey methods return remote reference. Rest of the finders return the enumeration of the ejbObjects ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ Cheers Ashwani Kalra Sr. Mem. Dev. Staff Aithent Technologies India www.geocities.com/ashwani_kalra/ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ -----Original Message----- From: An interest list for Sun Java Center J2EE Pattern Catalog [mailto:[EMAIL PROTECTED]]On Behalf Of Desai, Gopesh (Cognizant) Sent: Wednesday, December 19, 2001 1:27 PM To: [EMAIL PROTECTED] Subject: EJBObject Conversion!! Hi All, I have a strange beahviour in my application. Can anyone give me the explaination??? I have a Home Interface as shown below public interface CompanyHome extends javax.ejb.EJBHome { public Company create(CompanyDO companyDO) throws RemoteException, CreateException; public Company findByPrimaryKey(CompanyPK compPK) throws RemoteException, FinderException; public Company findByCompanyId(CompanyPK companyPK) throws RemoteException, FinderException; }// interface CompanyHome I have client in which i have following lines of codes CompanyHome m_companyHome = (CompanyHome) context.lookup(IJNDINames.FO_COMPANY_COMPANY); Enumeration enum = (Enumeration) m_companyHome.findByCompanyId(companyPK); findByCompanyId() method returns me Company EJBObject. When i compile my client code, compiler does not complain me of InCompatible conversion from Company to Enumeration. Can anyone explain me please???? Regards, Gopesh Desai << File: InterScan_Disclaimer.txt >> =========================================================================== 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".
