ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Jeff Butler" <jeffgbut...@gmail.com>
Subject Re: Postgres and generated keys
Date Tue, 20 Mar 2007 16:30:28 GMT
Postgres is not one of the supported dialects in Abator.  All this means is
that Abator does come preloaded with the proper statement to retrieve the
generated key.  So instead of "postgres", you'll need to figure out the
right statement yourself.

Jeff Butler




On 3/20/07, Mark Volkmann <mark@ociweb.com> wrote:
>
> Abator generates this in an SqlMap.xml file.
>
>   <insert id="abatorgenerated_insert"
> parameterClass="com.savealot.xademo.model.Address" >
>     <!--
>       WARNING - This element is automatically generated by Abator
> for iBATIS, do not modify.
>       This element was generated on Tue Mar 20 11:15:50 CDT 2007.
>     -->
>     insert into sal.address (street, city, state, zip)
>     values (#street:VARCHAR#, #city:VARCHAR#, #state:VARCHAR#,
> #zip:INTEGER#)
>     <selectKey resultClass="java.lang.Integer" keyProperty="id" >
>       Postgres
>     </selectKey>
>   </insert>
>
> When I attempt an insert that uses this, it chokes on "Postgres"
> inside the selectKey element.
>
> Perhaps I'm doing something wrong in my AbatorConfig.xml. Here's the
> part that pertains to the address table.
>
>     <table schema="sal"
>       tableName="address" domainObjectName="Address">
>       <generatedKey column="id" sqlStatement="Postgres"
> identity="true"/>
>     </table>
>
> Is the value for the sqlStatement attribute wrong?
>

Mime
View raw message