Appian Community
Site
Search
Sign In/Register
Site
Search
User
DISCUSS
LEARN
SUCCESS
SUPPORT
Documentation
AppMarket
More
Cancel
I'm looking for ...
State
Not Answered
Replies
19 replies
Subscribers
9 subscribers
Views
11786 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
Hi, I wonder if I could preset the id of a record to start with 1000 instead of
Will Teoh
over 11 years ago
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
Mike Schmitt
Certified Lead Developer
over 11 years ago
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...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Mike Schmitt
Certified Lead Developer
over 11 years ago
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...
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data