java - Hibernate Id Sequence Resulting null -
i have 1 table in postgresql database 2 id sequence.
@jsonproperty("id") @column(name = "id", nullable = false,unique=true) @id @generatedvalue(strategy = generationtype.identity,generator = "order_seq_gen") @sequencegenerator(name = "order_seq_gen", sequencename ="order_id_seq")
private integer id; @jsonproperty("state") private string state; @jsonproperty("order_id") @column(name="order_id", nullable=false, unique=true, insertable = false, updatable = true, columndefinition = "bigint default nextval('order_idgen_seq')" ) @generatedvalue(strategy = generationtype.sequence,generator = "order_seq_gen") @sequencegenerator(name = "order_seq_gen", sequencename ="order_idgen_seq") private integer orderid;
this pojo.
my issue orderid, if call crud repository save creating new record sequence starting values,
while returning object orderid resulting null there in table.
i have checked pojo , column mapping fine i'm not getting went wrong.
another id sequence returning without issue while coming orderid resulting null.
please me solve this, thankful them.
Comments
Post a Comment