I am using one to one mapping in my cdt's following the example mentioned in

I am using one to one mapping in my cdt's following the example mentioned in forum.appian.com/.../Defining_a_Custom_Data_Type . While making records for the same if i individually just print access code column in my EMPLOYEE i am getting an error access code column doesnt exist.I want just the access code field in my EMPLOYEE records.Hoe can i get that. Can anybody please help me with this as i am new to this tool .
Thanks in advance...

OriginalPostID-78279

OriginalPostID-78279

  Discussion posts and replies are publicly visible

Parents
  • Hi Himan,
    <xsd:complexType name="EMPLOYEE">
    <xsd:sequence>
    <xsd:element name="id" type="xsd:int">

    <xsd:element name="Name" type="xsd:string" />
    <xsd:element name="securityCard" type="ACCESS">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @OneToOne(cascade=ALL, optional=false)
    @JoinColumn(name="card_id", nullable=false, unique=true)
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ACCESS">
    <xsd:sequence>
    <xsd:element name="id" type="xsd:int">
              -----------
    </xsd:element>
    <xsd:element name="accessCode" type="xsd:string" />
    <xsd:element name="expirationDate" type="xsd:dateTime" />
    </xsd:sequence>
    </xsd:complexType>
    If you want to access 'id' in EMPLOYEE access as --> rf!id
    If you want to access 'accessCode' in 'ACCESS' then access it as --> rf!securityCard.accessCode (Here securityCard is the name of the 'ACCESS' entity that is referredOYEE). So here you need to use dot notation when you are traversing inside the CDT. Hope this answers your questions. If not or if you have any follow-up questions, please let me know.
Reply
  • Hi Himan,
    <xsd:complexType name="EMPLOYEE">
    <xsd:sequence>
    <xsd:element name="id" type="xsd:int">

    <xsd:element name="Name" type="xsd:string" />
    <xsd:element name="securityCard" type="ACCESS">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @OneToOne(cascade=ALL, optional=false)
    @JoinColumn(name="card_id", nullable=false, unique=true)
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>
    </xsd:sequence>
    </xsd:complexType>
    <xsd:complexType name="ACCESS">
    <xsd:sequence>
    <xsd:element name="id" type="xsd:int">
              -----------
    </xsd:element>
    <xsd:element name="accessCode" type="xsd:string" />
    <xsd:element name="expirationDate" type="xsd:dateTime" />
    </xsd:sequence>
    </xsd:complexType>
    If you want to access 'id' in EMPLOYEE access as --> rf!id
    If you want to access 'accessCode' in 'ACCESS' then access it as --> rf!securityCard.accessCode (Here securityCard is the name of the 'ACCESS' entity that is referredOYEE). So here you need to use dot notation when you are traversing inside the CDT. Hope this answers your questions. If not or if you have any follow-up questions, please let me know.
Children
No Data