Appian Community and Appian Academy are being upgraded. As a part of the upgrade, Appian Community is currently in read-only mode, and user registration is disabled until August 3. We apologize for any inconvenience this may cause, but a more secure, stable, and performant Community experience is coming soon!

The new Appian Community launches August 3, followed by Appian Academy on August 7. During the migration, Appian Community Edition, Appian Academy, Documentation, Certifications, Instructor-led Customer Training, Partner Sales Training & Accreditation, and Forum (for Appian Partners and Customers only) will remain available.

Hi, I am trying to map a composite key from a different CDT to another one

Hi,
I am trying to map a composite key from a different CDT to another one using one unique key inside xsd. How do I do it? Two columns from one cdt form a composite pair and I have another foriegn key coming from that table which defines the relationship. I want to map this foriegn key to that parent table inside CDT. What all JPA annotations should I use to get this behavior. I tried my best looking up online and troubleshooting with various things like @EmbeddedId, @Embeddable,@XmlInverseReference(mappedBy="fk_key")....but none of them parsed through appian cdt parser. Any help would be deeply appreciated.

OriginalPostID-202003

OriginalPostID-202003

  Discussion posts and replies are publicly visible

Parents Reply Children
  • when creating CDT (Data Type), choose "create from database table or view". If your database has the composite primary key, CDT also has it. 

  • 0
    Appian Employee
    in reply to AK47

    You can import it, but you can't actually use it. If you do this, you will see a message that says: "Data types without primary keys, or with more than one primary key, prevent data stores from publishing. In order to publish a data store that contains this data type, you must modify the data type so that it has only one primary key, then publish the data store. Otherwise, the data store will be saved as a draft."

    The CDT it self will be created but when you attempt to publish the data store it will fail. This means you can't read or write to the database, so the CDT itself becomes essentially useless. Composite keys are not supported in Appian when reading / writing to a database.