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
4 replies
Subscribers
10 subscribers
Views
1781 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Data and Records
I have a CDT that maps to a table. The CDT and the table has an ID column. Is th
guozhangy
over 10 years ago
I have a CDT that maps to a table. The CDT and the table has an ID column. Is there a way to insert a new row into the table using CDT with the ID value pre-assigned (suppose I want insert a row with ID=100). The Appian document only uses @GeneratedValue for the ID column. Is there any other annotation, such as @assigned...
OriginalPostID-137059
OriginalPostID-137059
Discussion posts and replies are publicly visible
0
Mike Schmitt
Certified Lead Developer
over 10 years ago
Have you tried just writing an instance of the CDT with an ID pre-assigned to the table? I could be misunderstanding what exactly you want to do, but I think it might do what you want.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
guozhangy
over 10 years ago
Thanks for the reply.
I tried that approach, I set the ID of the CDT to 100 (which doesn't exist in the table). A row was inserted into the table, but with different ID. The assigned value (100) was ignore by Appian.
I also tried not to use @GeneratedValue and Sequence for the ID column in my schema file, but then the schema will not be loaded.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
radhaa
over 10 years ago
Hi guozhang,
we can insert a new row into the table with pre-assigned Id value by these two annotations
@Id
@Column(name="id").
import the attached xsd file and give your own Id value to insert data, it will work.
hope it helps to you
TestGeneratedId.xsd
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
guozhangy
over 10 years ago
That works. Thank you so much.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel