java - Apache DBUtils QueryRunner returning ids from wrong column in insert -
i using apache dbutils
long rowid = queryrunner.insert(sql, new scalarhandler<long>(), params);
my table schema
create table abc ( userid bigint, api_key text, key_id integer not null default nextval('api_keys_key_id_seq'::regclass), constraint api_keys_pkey primary key (key_id), constraint userid_fkey foreign key (userid) references public.users (userid) match simple on update no action on delete no action )
problem rowid
coming userid
column primary key of table key_id
, want returning id of insert query key_id
column.
the solution followed create table again key_id
first column. in way key_id
returned in response insert query. there may option configure unable find.
i know creating table again not approach found answer please share.
Comments
Post a Comment