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
6 replies
Subscribers
9 subscribers
Views
2467 views
Users
0 members are here
Share
More
Cancel
Related Discussions
Home
»
Discussions
»
General
#Establishing constraints via xsd Hi, We have addressCDT and emp
senthilar
over 10 years ago
#Establishing constraints via xsd
Hi,
We have addressCDT and employeeCDT separately. But in the DB, we want address table to have a foreign key pointing to the employee table. We have added employeeId as a member in addressCDT (to hold the primary key from associated employee row). After publishing the CDTs in Appian, we are manually adding the foreign key constraint on this employeeId member using DDL script. But is there a way we can achieve the same in XSD itself? We want to maintain the CDTs separately only and do not want to add addressCDT into employeeCDT. Thanks!
OriginalPostID-148033
OriginalPostID-148033
Discussion posts and replies are publicly visible
0
senthilar
over 10 years ago
We tried this, but it didn't create the foreign key constraint:
<xsd:element form="qualified" name="employeeId" type="xsd:int">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@JoinTable(name="ADDRESS",
joinColumns=@JoinColumn(name="E_ID", referencedColumnName="EMPLOYEE_ID")
)</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
akshayan
Certified Lead Developer
over 10 years ago
Are you using it in conjunction with @OneToOne annotation?
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
senthilar
over 10 years ago
nopes the CDTs are totally independent of each other in Appian. The FK relationship is required only at DB layer
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
akshayan
Certified Lead Developer
over 10 years ago
@JoinColumn can be used only when you relate entities using another annotation like @OneToOne, @ManyToOne etc.Without that , foreign key relationship can not be automatically established.
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
rodgraham
Certified Lead Developer
over 10 years ago
Either nest the cdts or use the ddl, you could potentially nest a small version of the cdt rather than the full one which only contains the fk
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel
0
senthilar
over 9 years ago
Thank you All!
Cancel
Vote Up
0
Vote Down
Sign in to reply
Verify Answer
Cancel