Hello,
Suppose I have a existing "Person" and "Account" CDTs that use a foreign key.
Person: id, name, etc...
Account: id, personId, number, etc...
I want to create a separate nested CDT that is "Person", but contains "account" information. I want to be able to reference Person.Account in my cdt, but I do NOT want to add a separate database column. Is there a JPA annotation I can use in my "person" CDT to link the account data? I only know how to do this in the other direction (i.e. nest Person in Account).
Discussion posts and replies are publicly visible
Hi, you can use @JoinColumn annotation in parent cdt to link between parent and child cdt
Below is sample one, you can change it accordingly if it is one-one,
<xsd:element maxOccurs="unbounded" minOccurs="0" name="person" type="tns:Account">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">@OneToMany(cascade=CascadeType.ALL, indexed=false) @JoinColumn(name="personId")</xsd:appinfo>
</xsd:annotation>
</xsd:element>
Thank you,
Anji