ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Eric VanWieren" <evanwie...@gmail.com>
Subject Re: MySQL 'text' datatype mapping
Date Fri, 11 Aug 2006 03:03:42 GMT
Christian,

This is the declaration of the SourceClinic class

private String notes;

There are the appropriate getters and setters.

Here is the code for my SqlMap

<sqlMap namespace="SourceClinic">

    <select id="getSourceClinic" parameterClass="int" resultClass="
com.test.test.SourceClinic">
        SELECT
            ID             as id,
            NAME        as name,
            VISIBLE        as visible,
            DESC        as notes
        FROM SOURCECLINIC
        WHERE ID = #value#
    </select>

</sqlMap>

This is the desc from the mysql database
mysql> desc sourceclinic;
+---------+-------------+------+-----+---------+----------------+
| Field   | Type        | Null | Key | Default | Extra          |
+---------+-------------+------+-----+---------+----------------+
| id      | int(11)     |      | PRI | NULL    | auto_increment |
| name    | varchar(50) |      | UNI |         |                |
| desc    | text        | YES  |     | NULL    |                |
| visible | tinyint(1)  |      |     | 1       |                |
+---------+-------------+------+-----+---------+----------------+
4 rows in set (0.00 sec)

mysql>

Thanks for any help you can give me.

Eric


On 8/10/06, Poitras Christian <Christian.Poitras@ircm.qc.ca> wrote:
>
>  Can you send you sqlmap file?
> I use text fields with MySQL. So it is probably a config problem.
>
> Christian
>
>  ------------------------------
> *From:* Eric VanWieren [mailto:evanwieren@gmail.com]
> *Sent:* Wednesday, 09 August 2006 11:22
> *To:* user-java@ibatis.apache.org
> *Subject:* MySQL 'text' datatype mapping
>
> Hello,
>
> I have a field in one of my tables that is of type 'text' in my MySQL
> database. I am trying to map it back to a type of java.lang.String, but it
> keeps coming back telling me there is an error in my syntax.
>
> Am I missing something here? I can grab all the other values out of the
> table, just not the one for the field of type 'text'
>
> Thanks in advance.
>
> Eric
> -- iBatis newbie --
>

Mime
View raw message