Setting primary key

Hello ,

I have a requirement where i need to set the primary key of the cdt through an xsd and not using the interface .Which annotation can be used for the same ? I tried searching through existing CDT's for the setting primary key annotation but was not able to find one. Any help will be appreciated.

Thanks,

Rohit Ouhal

  Discussion posts and replies are publicly visible

Parents
  • Hi,

    You can use the below code for setting the primary key through XSD:
    <xsd:element name="EmployeeId" nillable="true" type="xsd:int"><xsd:annotation><xsd:appinfo source="appian.jpa">@Id @GeneratedValue</xsd:appinfo></xsd:annotation></xsd:element>
    If you want that particular field to set as primary key and auto generated then you can use above code in XSD file.
Reply
  • Hi,

    You can use the below code for setting the primary key through XSD:
    <xsd:element name="EmployeeId" nillable="true" type="xsd:int"><xsd:annotation><xsd:appinfo source="appian.jpa">@Id @GeneratedValue</xsd:appinfo></xsd:annotation></xsd:element>
    If you want that particular field to set as primary key and auto generated then you can use above code in XSD file.
Children
No Data