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
12 replies
Subscribers
9 subscribers
Views
5135 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
XSDs annotations getting lost during creating/updating a CDT
Sandro Oberdorfer
A Score Level 2
over 8 years ago
Heya all,
I just created some new CDTs via importing some XSDs and updated another couple of existing CDTs via XSD-uploads. In each case I only added one annotation to index a field. Here is one example:
Before:
<xsd:element name="leadId" nillable="true" type="xsd:int" />
After my changes:
<xsd:element name="leadId" nillable="true" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@Index(name="LMW_ProcessData_leadId")</xsd:appinfo>
</xsd:annotation>
</xsd:element>
So after I made these changes and created/updated I took a look into the XSDs to double check via downloading the CDTs XSD from Appian, but my annotation was completely gone. It looked like this again:
<xsd:element name="leadId" nillable="true" type="xsd:int" />
Afterwards I looked into the database and behold: The index was actually there. So basically I got my...
OriginalPostID-250036
Discussion posts and replies are publicly visible
0
Sandro Oberdorfer
A Score Level 2
over 8 years ago
... desired outcome but the information to WHY the index is there got completely lost, which is less than ideal of somebody ever wants to understand what I did.
Is there a way to not lose the XSD annotations in during this process?
Thank you for your time!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Krishna Chaitanya
A Score Level 1
over 8 years ago
hi @ sandroo
have a look at the below link
forum.appian.com/.../Custom_Data_Types_from_XSD.html
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sandro Oberdorfer
A Score Level 2
over 8 years ago
Thank you. So I guess I have to use the @Column annotation, but do you know how it should look like if I want to use the additional attribute index like it says there?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
chandu
A Score Level 2
over 8 years ago
I haven't tried but its worth trying, Could you Please check the below syntax for @table annotation.
@Table(name="<table Name>",
indexes = {
@Index(name = "Index Name", columnList = "Column Name"),
@Index(name = "Index Name", columnList = "Column Name"),
}
)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 8 years ago
@sandroo as per my understanding Appian do not have support for @Index Annotation, so after uploading it might be getting disappeared, if I am not wrong while uploading your Annotation based xsd file, you might have got some warnings also. If you can say your requirement so that we can suggest you the suitable Annotation for your requirement
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 8 years ago
However @Index Annotation is supported in JPA 2.1, but I didn't find @Index Annotation in Appian documentation as mentioned by @Chaitanya above, so try to explain your requirement so that Appian practitioner can help you on this
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Krishna Chaitanya
A Score Level 1
over 8 years ago
hi @ sandroo
<xsd:element name="leadId" nillable="true" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Column(name="leadId",columnDefinition="INT(3)")
</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
Sandro Oberdorfer
A Score Level 2
over 8 years ago
Thanks for your answers guys!
I tried the idea of @chandrasekharg, like this:
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@Table(indexes={
@Index(name="test_index", columnList="leadId")
}
)
</xsd:appinfo>
</xsd:annotation>
The import of this modfied XSD resulted in the following error:
A type mapping annotation is invalid: No efeature indexes for eclass Table (APNX-2-4055-000)
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 8 years ago
@sandroo i don't think, there is any Element named as indexes for @Table Annotation, that might be causing you the issue, if you can explain your requirement, then only we can come to some Resolution for your requirement
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
aloks0189
Certified Lead Developer
over 8 years ago
As per my Knowledge, there are only four Elements of @Table Annotation, those are
catalog, name, schema, uniqueConstraints
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
>