I also use the form:
 
<typeAlias alias="Contact" type="ExampleNamespace.Contact,
ExampleAssemblyName"/>

One thing to look out for is to make sure your class is public and to make
sure you have a public no-args constructor. This has bitten me when I'm not
paying attention. :)

- Kit

________________________________

From: Joe Chandler [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 27, 2005 6:03 PM
To: ibatis-user-cs@incubator.apache.org
Subject: RE: Problem with 'typeAlias'


Not sure of exactly what you had put in the config as far as XML for alias,
but here is an example:

 
       <alias>
              <typeAlias alias="MoveRequest" 
                     assembly="iBatisExample.dll" 
 
type="Autodesk.Consulting.BrownBags.iBatis.beans.MoveRequest" />
       </alias>
 

Alias can be any name you like

Assembly should be the name of the assembly that the type is in.

Type is the fully qualified class name.

 

-Hope that helps

 

________________________________

From: Thompson, Kent [mailto:[EMAIL PROTECTED] 
Sent: Thursday, January 27, 2005 4:56 PM
To: ibatis-user-cs@incubator.apache.org
Subject: Problem with 'typeAlias'

 

I was wondering if anybody has seen an error when adding a 'typeAlias' tag
to a sql map.  I'm assuming this is the method for referencing a class that
lives in different assembly.

I'm seeing a "Could not load type with a null or zero length parameter" when
adding a typeAlias (even if the class is contained in the same assembly that
is usng Ibatis).  If I remove all of the 'typeAlias' elements from the
'alias' element, I don't get the above error, but I do get a 'Could not load
type: <class name>".

BTW:  All of the asseblies are sitting in the bin/debug directory of the
project.  So, I don't think it is a path issue.

If this sounds familiar, let me know -- I'm new to Ibatis and it might just
be a configuration goof. 

Thanks, 
Kent 

 


Reply via email to