Why jooq is not returning when mysql table has a unique index? -


mysql table

create table `user` (   `id` int(10) unsigned not null auto_increment,   `telphone` varchar(32) not null,   `name` varchar(64) not null default '',   `password` varchar(64) not null default '',   `balance` int(11) not null default '0',   `user_type` int(2) not null,   primary key (`id`),   unique key `phone_index` (`telphone`) using btree ) engine=innodb auto_increment=28 default charset=utf8; 

and code write :

@service public class commondao {     @resource     private dslcontext jooqcontext;      public <r extends record> r insertandget(table<r> table, r r, field<?>... f) {         return jooqcontext.insertinto(table).set(r).returning(f).fetchone();     } } 

it return null when use insert , get, , data insert database. when delete unique key in mysql, works fine.


Comments

Popular posts from this blog

powershell Start-Process exit code -1073741502 when used with Credential from a windows service environment -

twig - Using Twigbridge in a Laravel 5.1 Package -

c# - LINQ join Entities from HashSet's, Join vs Dictionary vs HashSet performance -