CDT: Customize table name for a field in the CDT which is an integer array

We have a CDT (Response_Details), and one of the fields in the CDT (answerId) is an integer array. When we published this CDT to DS, it created a table internally. Is there a way to customize the table name and column name generated by Appian for this? Can we use any annotation to achieve this? I know we can create a new CDT and create an one-many relation in the Response_Details CDT to map the data, but if there is any way we can customize the table / field names for the table auto-generated by Appian for publishing the integer array field, that'll be helpful. Thanks in advance.

  Discussion posts and replies are publicly visible

Parents Reply Children
  • Hi Colton
    Thanks for the response. Not sure if I am missing anything here, but I used the following annotation in my XSD, and it does not seem to be working.

    <xsd:element maxOccurs="unbounded" minOccurs="0" name="answerId" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="answerId", table="Map_Response_Answer")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    The CDT is published successfully, but it does not create the table: Map_Response_Answer, instead it's looking for the auto-generated table. Wondering if we can have our custom table instead of the auto-generated table in this case.
    Thanks again.
  • I am using the following CDT XSD -

    <xsd:schema xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:tns="urn:com:appian:types:IA" targetNamespace="urn:com:appian:types:IA_Response_Details">
    <xsd:complexType name="IA_Response_Details">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @Table(name="IA_Response_Details")
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="responseId" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Id @GeneratedValue</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="allocationId" nillable="true" type="xsd:int" />
    <xsd:element name="questionId" nillable="true" type="xsd:int" />
    <xsd:element maxOccurs="unbounded" minOccurs="0" name="answerId" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Column(name="answerId", table="IA_Map_Response_Answer")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    <xsd:element name="response" nillable="true" type="xsd:string" />
    <xsd:element name="comment" nillable="true" type="xsd:string" />
    <xsd:element name="isActive" nillable="true" type="xsd:boolean" />
    <xsd:element name="isDeleted" nillable="true" type="xsd:boolean" />
    <xsd:element name="createdBy" nillable="true" type="xsd:string" />
    <xsd:element name="createdDate" nillable="true" type="xsd:dateTime" />

    </xsd:sequence>
    </xsd:complexType>
    </xsd:schema>

    Appreciate the assistance.
  • 0
    A Score Level 2
    in reply to soumyab103

    Please refer the below link looks like

    https://forum.appian.com/suite/help/16.3/Custom_Data_Types_from_XSD.html

    after the end tag of "complexType" of IA_Response_Details, we need to start one more complex type of "IA_Map_Response_Answer" in this way it will create a relationship table.