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
8 replies
Subscribers
7 subscribers
Views
6150 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
What am I doing wrong here? I'm trying to import a CDT that maps to one of o
dylanf
over 11 years ago
What am I doing wrong here? I'm trying to import a CDT that maps to one of our existing tables on our MS SQL database. When I try to import the cdt using the @Id annotation, I get this error:
A type mapping annotation is invalid: The eclass: HbAnnotatedEReference does not have an efeature for Id (APNX-2-4055-000)
However, when I remove the @Id annotation, when I try to create a data entity that uses the cdt, it balks saying that my table doesn't have an a_id column. I'm attaching the xsd for reference....
processstreamresolution.xsd
OriginalPostID-110266
OriginalPostID-110266
Discussion posts and replies are publicly visible
0
Owen Parrish
Appian Employee
over 11 years ago
<xsd:element minOccurs="0" name="KeyProcessStreamResolution"> is missing the type attribute. If you add type="xsd:int" the CDT imports fine.
<xsd:element name="KeyProcessStreamResolution" type="xsd:int">
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Ricardo Galvan
Appian Employee
over 11 years ago
Try the attached file
processstreamresolution.xsd
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
dylanf
over 11 years ago
Thanks, Owen. I actually ended up using type="xsd:ID" since this is a GUID and not an integer (MS SQL uniqueidentifier), and the CDT did import fine, but when I tried to verify the data entity, I'm now getting this error:
The data source schema does not match the type mappings: Wrong column type in ObjectViews.dbo.InternalProcessResolution for column KeyProcessStreamResolution. Found: uniqueidentifier, expected: nvarchar(255) (APNX-2-4056-000)
Any thoughts on this?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Ricardo Galvan
Appian Employee
over 11 years ago
This would suggest that KeyProcessStreamResolution was created in the table as a nvarchar(255) but you are passing a GUID, you would have to modify the table to change the type to accept a GUID and try again.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
dylanf
over 11 years ago
Well, Appian isn't creating these tables. I'm just trying to create a data entity based on an imported cdt that mirrors the existing table structures. In this case (and many others), the PK of the table uses the MS SQL datatype "uniqueidentifier," (and was defined thusly since the table was created) but there doesn't seem to be an xsd type that matches up with uniqueidentifier.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
dylanf
over 11 years ago
further, it doesn't seem that we can use sqltypes:uniqueidentifier since on the cdt import, the upload xsd file wizard balks at several other sqltypes defined in the schema.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Owen Parrish
Appian Employee
over 11 years ago
In the documentation, there's a good table that shows how different types map between XSDs, Appian, and the RDMBS.
forum.appian.com/.../Defining_a_Custom_Data_Type
For all intents and purposes, since a GUID is just a string, trying using type="xsd:string." You can use the columnDefinition attribute of the @Column annotation to explicitly tell Appian what the column type is in the RDBMS.
forum.appian.com/.../Defining_a_Custom_Data_Type
<xsd:element name="KeyProcessStreamResolution" type="xsd:string">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Id
@GeneratedValue
@Column(name="KeyProcessStreamResolution", columnDefinition="uniqueidentifier")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
dylanf
over 11 years ago
Thanks, Owen. That worked.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel