From: Jeff Butler <jeffgbut...@gmail.com>
Date: Tue, 24 Apr 2012 07:41:38 -0400
Local: Tues, Apr 24 2012 7:41 am
Subject: Re: Doubt with mybatis-generator and generatedKey
The generator will not automatically discern auto increment columns.
If you do something like this: <table name="%"> then the generator will assume that ALL tables have an "id" column Jeff Butler On Tue, Apr 24, 2012 at 1:22 AM, Javier Domingo <javier...@gmail.com> wrote:
> El 24/04/2012 07:13, "Bogdan Tanase" <bftan...@gmail.com> escribió: >> Hi Javier, >> For autoincrement I use this: >> <generatedKey column="id" sqlStatement="JDBC"/> > This seems much cleaner than the other option (which is more specific) and I >> and the autoincremented value is received from the driver. Works fine with >> upon insert the generated id is assigned to the id property of your pojo. >> Order order = new Order(); >> // at this point order.id has the generated autoincrement value >> If you don't use generatedKey, inserts should work fine, but the id >> I hope it helps, I didn't had my coffee yet :) > And about making all autoincrementable columns to use it? >> On Tue, Apr 24, 2012 at 2:48 AM, Javier Domingo <javier...@gmail.com> >>> Hi, >>> I have been looking at the docs of mybatis-generator etc. And I have >>> The idea is that I can specify a database connection, and it will take >>> If I want to insert a new object in a table, and I want it to be with the >>> And now the questions come: >>>> <table tableName="%"> >>> I will get all the tables in the database, and >>> Is there any way to make the generator use auto_increment feature in all >>>> <table tableName="%"> >>> In the documentation says it will set the generatedKey element to the >>> I Hope you understood my English, >>> Cheers, >>> Javier Domingo You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.
| ||||||||||||||