How do we map a CDT to a database view??/ Any documentation related to vie

Certified Senior Developer
How do we map a CDT to a database view??/
Any documentation related to views & CDT is very helpful.
We tried creating a CDT with annotations but it creates a table in the DB. Is there any extra anootations / tags we need to take crae for views. We have created a view in the database in MS SQL....

OriginalPostID-76078

OriginalPostID-76078

  Discussion posts and replies are publicly visible

Parents
  • You have put a primary key in it by @Id annotation
    and the database view will have atleast 1 non null unique column


    <xsd:schema xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:tns="urn:com:appian:types:MP" targetNamespace="urn:com:appian:types:MP">
    <xsd:complexType name="Test">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @Table(name="Test")
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="Id" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Id @Column(name="Id", columnDefinition="int")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
Reply
  • You have put a primary key in it by @Id annotation
    and the database view will have atleast 1 non null unique column


    <xsd:schema xmlns:xsd="www.w3.org/.../XMLSchema" xmlns:tns="urn:com:appian:types:MP" targetNamespace="urn:com:appian:types:MP">
    <xsd:complexType name="Test">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @Table(name="Test")
    </xsd:appinfo>
    </xsd:annotation>
    <xsd:sequence>
    <xsd:element name="Id" nillable="true" type="xsd:int">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">@Id @Column(name="Id", columnDefinition="int")</xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
Children