ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Rick" <ricks_mailingli...@arc-mind.com>
Subject How do you map a Java boolean property to a VARCHAR(1) that contains 'Y' or 'N'?
Date Wed, 28 Jun 2006 23:06:40 GMT
 

I have a SQL map as follows:

 

      <resultMap id="contacts" class="qcom.cas.mysourcej.poc.model.Contact">

            <result property="name" column="contact_name"/>

            <result property="primaryContact" column="primary_contact" />

      </resultMap>

 

The class Contact has a primaryContact field is boolean

The result set is from a column that is equal to 'Y' or 'N' in the database.

 

Is there a way to map a boolean property (primitive) to a VARCHAR(1) NOT
NULL column (that has either a 'Y' or a 'N')?

 

This is a legacy database and there is no way I can change the table. I
could change the query.

 

 

BTW I am new to iBatis, and I got it talking to a legacy db. I also setup
relationships fairly easily.

 

 

I did notice the typeHandler attribute of resultMap but this is not
documented in the dtd or user documents.

 


Mime
View raw message