ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: Problem with using generic and specific custom TypeHandlers
Date Mon, 15 May 2006 07:32:13 GMT
Are you using the DTD for your sqlmap configfile? There is no such
element "typeHandlers"...


-----Original Message-----
From: Tracey Annison [mailto:tannison@trisystems.co.uk] 
Sent: maandag 15 mei 2006 9:20
To: user-java@ibatis.apache.org
Subject: RE: Problem with using generic and specific custom TypeHandlers

Thanks, Ben. 

Well, I now have XML like this : 

Generic TypeHandler in the sql-map-config.xml- 
	<typeHandler javaType="uk.co.package.user_type.FlagANY"

And in the thing.xml I have a ResultMap and ParameterMap like this - 
<resultMap id="thingResult"
        <result column="OCFRED" property="fred"/>
        <result column="OCBILL" property="bill"

<parameterMap id="thingResult"
        <parameter  property="fred"/>
        <parameter property="bill"

And I have Java code like this for ThingIbatis - 
import uk.co.package.user_type.FlagANY;

public class ThingIbatis implements Comparable<ThingIbatis> {

    private FlagANY fred = FlagANY.N;
    private Boolean bill = FlagYN.getDefaultBoolean();

    public FlagANY getFred() {
        return this.fred;

    public Boolean getBill() {
        return this.bill;

    public void setFred(FlagANY fred) {
        this.fred = fred;

    public void setBill(Boolean bill) {
        this.bill = bill;

And I'm still not getting the specific TypeHandler called. The
TypeHandlerStringANYEnum works fine for fred, but the
TypeHandlerStringYNBoolean is never invoked for bill.

I can't see what else I ought to be doing...

Tracey Annison

View raw message