ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From dr-iba...@gmx.de
Subject Missing Type-Conversion with Postgres-Jdbc-Driver 8.1-407
Date Fri, 17 Nov 2006 16:37:28 GMT
Hello,

I have the following problem:

I have a simple object

public class MyObject {
 private String id = "";
 public String getId() { return id; }
 public void setId(String id) { this.id = id; }
}

, a database with a table

CREATE TABLE myobject(id serial NOT NULL)

and a map-file

<sqlMap>
 <parameterMap id="MyObjectParameter" class="main.MyObject">
  <parameter property="id" jdbcType="INTEGER"/>
 </parameterMap>
 <insert id="insertMyObject" parameterMap="MyObjectParameter">
  <selectKey keyProperty="id" resultClass="string">SELECT nextval('myobject_id_seq')</selectKey>
  INSERT INTO myobject (id) VALUES (?)
 </insert>
</sqlMap>


With the Postgres-Jdbc-Driver 7.4.213 everything is ok,
but with 8.1-407-Driver I get an exception
ERROR: column "id" is of type integer but expression is of type character varying
though I have set the jdbcType to INTEGER. So it seems, that there
is no conversion done. What have I done wrong?

Thank you
Dennis
-- 
Der GMX SmartSurfer hilft bis zu 70% Ihrer Onlinekosten zu sparen! 
Ideal für Modem und ISDN: http://www.gmx.net/de/go/smartsurfer

Mime
View raw message