modified to keep the value of primary key on a table in O/R mapper.