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
5 replies
Subscribers
7 subscribers
Views
3510 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
Integrations
Trying to map a CDT to a view in my database. XSD attached. When I attempt to cr
John Stretton
over 9 years ago
Trying to map a CDT to a view in my database. XSD attached. When I attempt to create a data store entity for this CDT, Appian wants to execute the following line in a DDL script:
add aid numeric(19,0) not null;
Obviously this fails because you can't add a column to a view. What am I missing? How can I get Appian to stop trying to add this column?
RFP_DeadlineAlerts.xsd
OriginalPostID-171284
OriginalPostID-171284
Discussion posts and replies are publicly visible
0
Jorge Sanchez
Appian Employee
over 9 years ago
Try using backticks when defining names with underscores:
@Column(name="`a_id`",columnDefinition="int",nullable=false) @Id
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rawich
over 9 years ago
@johns222, Appian is trying to add primary key to your view (but Appian doesn't know that and it assumed, it's a table).
One workaround to this is to create your view with primary key from original table as well, and mark it as primary key when you create the CDT.
If you have no control over the view definition, you'll have to define composite primary key by modifying the XSD directly and use @Id in the annotation of multiple columns.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
patrickh
over 9 years ago
To the best of my knowledge, Appian does not support composite primary keys. One, and only one, of the fields in your CDT needs to be marked as the primary key. Because this is a view, it should not matter what field you pick since the contents of the view is determined by a query on the DB side. That said, @rawichp236 makes a good point that it is a good idea to include a primary key from one of your tables in your view to use as the primary key for your CDT.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Shyam Bommakanti
Certified Lead Developer
over 9 years ago
The attached CDT has the @id defined. I guess the issue could be the _ as Jorge said try backticks `
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
John Stretton
over 9 years ago
Jorge's solution worked. Thank you!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel