you selectKey is returning a "string". shouldn't it return an "integer"?

Brandon

On 11/17/06, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:

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

Reply via email to