ibatis-user-cs mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jason Taylor" <jtay...@escoinst.com>
Subject RE: Getting wrong type back from DaoManager.GetType()
Date Wed, 08 Feb 2006 04:57:53 GMT
Sorry, my actual program code uses a cast too; the code in my first email
incorrectly omitted the cast.
However, I still get the error with or without the cast.

I got the impression from reading up on the Castle Project website that
DynamicProxy doesn't support Generics.  
I think this is likely my problem because the error arrived about the same
time I began using Generics extensively.

If anyone has any info on the subject of succesfully designing IDaos, Daos,
and their respective services using Generics I would love to hear from you.

Thanks,

J 

-----Original Message-----
From: Ron Grabowski [mailto:rongrabowski@yahoo.com] 
Sent: February 7, 2006 9:52 PM
To: user-cs@ibatis.apache.org
Subject: Re: Getting wrong type back from DaoManager.GetType()

I've always casted the result from GetDao():

 _companyDao = (ICompanyDao)_daoManager.GetDao(typeof(ICompanyDao));

--- Jason Taylor <jtaylor@escoinst.com> wrote:

> Hello all,
> 
> The DaoFactory portion of my dao.config is configured thus:
> ...
> <daoFactory>
> 	<dao
> interface="Data.Persistence.Interface.Directory.Core.ICompanyDao,
> Data.Persistence" 
> 	
> implementation="Data.Persistence.SqlMapper.Directory.Core.CompanyDao,
> Data.Persistence" />
> </daoFactory>
> ...
> 
> 
> Within my CompanyService class, my call to:
> 	_companyDao = _daoManager.GetDao( typeof( ICompanyDao ) )	
> 
> sets _companyDao as the following type:
> 	{ProxyInterfaceCoreCompanyDao_ICompanyDao_IDao_ISerializable}
> 
> rather than the expected:
> 	{Data.Persistence.SqlMapper.Directory.Core.CompanyDao}
> 
> 
> I am using Generics here and there in the code; could that be the
> problem?
> If so, where should I NOT use Generics?
> 
> Thanks,
> 
> Jason
> 
> 
> 





Mime
View raw message