Hey there - I'm new to JOOQ and playing around with it for possible use on 
my next project.

I'm using MySQL + JOOQ 3.0.0-RC3

here's a quick snippet:

DSLContext create = DSL.using(this.connection, SQLDialect.MYSQL);
>
>
>> GreetingRecord record = create.newRecord(GREETING);
>
> record.setGreetingtext("blah");
>
>
>> record.store();
>
> System.out.println("-> " + record.getId());
>
>
the ID isn't populated

I've tried various permutations of this, with no luck:

 create.insertInto(GREETING, 
> GREETING.GREETINGTEXT).values(greeting.getGreetingText()).returning(GREETING.ID).fetch().getValues(GREETING.ID);
>

here's the DDL of the table:

CREATE TABLE `greeting` (
>
>   `id` bigint(20) NOT NULL AUTO_INCREMENT,
>
>   `greetingText` text COLLATE utf8_bin NOT NULL,
>
>   PRIMARY KEY (`id`)
>>
> ) ENGINE=InnoDB AUTO_INCREMENT=36 DEFAULT CHARSET=utf8 COLLATE=utf8_bin$$
>
>
>>
 the inserts succeed, but I can't seem to get the generated key back; I'd 
like to use JOOQ directly and not dive down into the JDBC statement layer

I think I'm just misunderstanding how to use the API - is there a direct 
way to return the ID/key MySQL auto incremented for me?

Thanks

S
 

-- 
You received this message because you are subscribed to the Google Groups "jOOQ 
User Group" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to