Hi, I wonder if I could preset the id of a record to start with 1000 instead of

Hi, I wonder if I could preset the id of a record to start with 1000 instead of 1 when it stores to the database table? Anything to add into the codes below to make that happen?? Thanks

<xsd:annotation>
<xsd:appinfo source="appian.jpa">
                                                            @Id
                                                            @GeneratedValue
                                                  </xsd:appinfo>
</xsd:annotation>...

OriginalPostID-95347

OriginalPostID-95347

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer
    does the constraint have to be on the XSD side? if it were me, I'd probably just do a low-impact query on the DB table before writing anything, and if it's empty, manually set the ID of the first record to 1000. I forget whether subsequent writes would follow the previous pkId (i think they might but i'm not sure), but even if not, you could always manually set each object's Id to be max( existing ID's )+1...
Reply
  • 0
    Certified Lead Developer
    does the constraint have to be on the XSD side? if it were me, I'd probably just do a low-impact query on the DB table before writing anything, and if it's empty, manually set the ID of the first record to 1000. I forget whether subsequent writes would follow the previous pkId (i think they might but i'm not sure), but even if not, you could always manually set each object's Id to be max( existing ID's )+1...
Children
No Data