The insert method will always return int. It is the number of rows inserted, not the new key. The new key value is available in the corresponding property if the row object after the insert. Insert methods will almost always return 1.
Jeff Butler
On Tuesday, March 13, 2012, Jason Bennett <
[hidden email]> wrote:
>
> I'm generating a full Mybatis stack from my MySQL database, using the maven plugin. One table has a primary key of type BIGINT(20). The XML that is generated has a selectKey tag with a resultType of Long (which seems correct). However, the generated insert() method in the mapper interface returns an int. I've tried setting the column override, without success. How can I get the generated mapper to match the XML, and possibly to produce Long objects instead of primitives?
>
> jason
>