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
11785 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
Eduardo Fuentes
Appian Employee
over 10 years ago
This is creating a sequence generator where the initial value should be 1,000 and its name is MY_SQ and will increment by 1 (since not using any value for the allocationSize attribute). More details on each of these three arguments (name, initialValue and allocationSize at
docs.oracle.com/.../SequenceGenerator.html).
In the second line I declare that my primary key is going to be using a sequence that will get its configuration from a generator previously defined as MY_SQ
@SequenceGenerator(name="MY_SQ", initialValue=1000)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MY_SQ")
You may want to delete the sequence from MySQL and republish the data store to see if that helps.
When you click on the "Verify Data Store" button see if you can download the DDL to make sure the sequence is going to be created correctly with the initial value set to the specified number
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Reply
0
Eduardo Fuentes
Appian Employee
over 10 years ago
This is creating a sequence generator where the initial value should be 1,000 and its name is MY_SQ and will increment by 1 (since not using any value for the allocationSize attribute). More details on each of these three arguments (name, initialValue and allocationSize at
docs.oracle.com/.../SequenceGenerator.html).
In the second line I declare that my primary key is going to be using a sequence that will get its configuration from a generator previously defined as MY_SQ
@SequenceGenerator(name="MY_SQ", initialValue=1000)
@GeneratedValue(strategy=GenerationType.SEQUENCE, generator="MY_SQ")
You may want to delete the sequence from MySQL and republish the data store to see if that helps.
When you click on the "Verify Data Store" button see if you can download the DDL to make sure the sequence is going to be created correctly with the initial value set to the specified number
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
Children
No Data