So what's happening is I have a One-To-Many relationship between a Parent entity and a Child entity. I want to create a flat relationship between the two entities instead of having to nest my Child CDT within my parent CDT, so meaning I want to have an INT field within my Child CDT, which will contain an INT value equivalent to the PRIMARY KEY value of the Parent CDT.
I referred to this documentation here: https://docs.appian.com/suite/help/19.4/cdt_design_guidance.html and had put the @JoinColumn annotation inside of my Child FK field in order to reference my parent CDT. My question is how does Appian know which table to reference as the child entity's parent? I also tried passing in my parent table inside the table parameter inside the @JoinColumn annotation.
Discussion posts and replies are publicly visible
This is actually the way I prefer to handle nested relationships, because at the end of the day, dealing with flat CDTs and tables can be quite a bit less of a headache than dealing with nested ones.
The trick is, the child CDT doesn't know or care what the parent relationship is when you don't nest the CDTs. You just keep track of it manually within your process. Disclaimer, I'm not all that sure what the @JoinColumn annotation does - my suspicion is that it's not really relevant when you're dealing with a strictly flat relationship structure (and dealing with the nesting aspects manually).
Look up XSD keyref and XSD key commands.
I think @JoinColumn specifically refers to JOIN commands, which you can also do in XSD.
Thanks for the suggestions.
In the end, we are going to go with the approach to manually create the DB table first with the Foreign Key, and then to map our CDTs with the db tables.
I believe the commands xsd:key and xsd:keyref aren't supported in Appian.