added logic to generate ids for primary key of type idgenerated