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

  • 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
Reply

  • 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
Children
No Data