ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Tom Duffey <tduf...@utilivisor.com>
Subject Re: Problem w/enum and TypeHandlerCallback
Date Tue, 17 Oct 2006 16:35:50 GMT

On Oct 17, 2006, at 11:25 AM, Tom Duffey wrote:

>
> On Oct 17, 2006, at 11:22 AM, Jeff Butler wrote:
>
>> Never mind - the change was made prior to that.  BTW - the fisheye  
>> link on the iBATIS homepage is VERY usefull when trying to see  
>> what shanges have been committed to SVN.
>>
>> I'll take a look in my own environment.
>>
>
> Actually I just realized that I only deployed ibatis-sqlmap-2.jar  
> from trunk into my application so if the change was in ibatis- 
> common then I didn't pick it up.  I'm rebuilding now and will  
> deploy everything from trunk and let you know if it helps.

Same NPE after deploying latest ibatis-common and ibatis-sqlmap jars  
from trunk.  To recap, my type handler implementation is working fine  
because specifying it explicitly in the inline parameter map works.   
The only difference I see in my setup compared to others is I define  
my enums in implements, e.g.,

public interface Something {
	public enum Type { NORMAL, WEIRD }
	...
}

and iBATIS maps to things that implement Something, e.g.,

public class WonderfulThing implements Something {
	private Type type;
	getType()
	setType()
	...
}

and without the explicit type handler mapping for that attribute  
iBATIS generates the NPE on insert/update.  Declaring SomethingType  
externally also works but I'd rather not do that.

Tom

>> On 10/17/06, Tom Duffey <tduffey@utilivisor.com> wrote:
>>
>> On Oct 17, 2006, at 11:05 AM, Jeff Butler wrote:
>>
>>> That's a good clue.  There was a problem with the iBATIS  
>>> introspector related to interface hierarchies.  This is now fixed  
>>> in SVN, but not released yet.  If you're up for it, would you try  
>>> an iBATIS build from source and see if the problem persists?
>>>
>>
>>
>> I'm already using trunk from a couple days ago but will update and  
>> try again.
>>
>>
>> Tom
>>
>>> On 10/17/06, Tom Duffey <tduffey@utilivisor.com > wrote:
>>>
>>> On Oct 17, 2006, at 10:53 AM, Jeff Butler wrote:
>>>
>>>> There haven't been many changes since the 2.2.0 release - and  
>>>> none in this area of the code.  Probably not the issue.
>>>>
>>>> My question is this - why is UnknownTypeHandler being called at  
>>>> all?  iBATIS only calls this when it does not find a registered  
>>>> type handler.  My guess is that you're not declaring the type  
>>>> handler properly.
>>>
>>>
>>> Could it have something to do with my enums being declared in  
>>> interfaces?  That's the only difference I see between my setup  
>>> and what others claim are working.
>>>
>>>
>>> Tom
>>>
>>>
>>
>>
>


Mime
View raw message