Query around Primary Key in Appian My SQL Database

Hi All,

 

I am working on version 18.1.

 

I have a few queries around Primary Key in Appian's MY SQL database:

 

1. In my MySQL database, if I want to create two columns as primary key i.e. if I want to create a composite key rather than making just one column as a primary key then how can I do that as in my data type Appian allows to create only one column as primary key though in XSD we can add two columns as primary key using @Id annotation. So I would like to know how can I achieve this or I can only create one column as primary key.

2. Also would like to know in which scenario do I get Unique Key Constraint violated error.

 

Thanks in advance!!

  Discussion posts and replies are publicly visible

Parents Reply Children
  • 0
    A Score Level 1
    in reply to paragk998

    PFB the xsd:

     

    <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:tns="urn:com:appian:types:MYAPP" targetNamespace="urn:com:appian:types:MYAPP">
      <xsd:complexType name="MYAPP_Security">
        <xsd:annotation>
          <xsd:appinfo source="appian.jpa">
            @Table(name="MYAPP_SECURITY")
    	  </xsd:appinfo>
        </xsd:annotation>
        <xsd:sequence>
          <xsd:element name="id" nillable="true" type="xsd:int">
            <xsd:annotation>
              <xsd:appinfo source="appian.jpa">@Id</xsd:appinfo>
            </xsd:annotation>
          </xsd:element>
          <xsd:element name="firstName" nillable="true" type="xsd:string">
            <xsd:annotation>
              <xsd:appinfo source="appian.jpa">@Id @Column(length=255)</xsd:appinfo>
            </xsd:annotation>
          </xsd:element>
          <xsd:element name="lastName" nillable="true" type="xsd:string">
            <xsd:annotation>
              <xsd:appinfo source="appian.jpa">@Column(length=255)</xsd:appinfo>
            </xsd:annotation>
          </xsd:element>
        </xsd:sequence>
      </xsd:complexType>
    </xsd:schema>

     

    Screen shot of Table structure: