Hi All, Here is my situation for writing xsd's had 3 c

Hi All,

Here is my situation for writing xsd's

had 3 cdt's

1. client - xsd created - table created
2. employee - xsd created - table created

3. pay

in this pay cdt PK of client and PK of employee are the foreign keys and they are mapped with "many to one" relationship with those 2 (means many records in pay can have single client or employee )

I already have referred forum.appian.com/.../Defining_a_Custom_Data_Type

and written xsd for pay with following annotations.

<?xml version="1.0" encoding="utf-8" ?>
<xsd:schema xmlns="urn:appian:example:assocations:many-to-one" elementFormDefault="qualified" targetNamespace="urn:appian:example:assocations:many-to-one" xmlns:xsd="www.w3.org/.../XMLSchema">

<xsd:complexType name="pay">
--
<xsd:element minOccurs="0" nillable="false" maxOccurs="unbounded" name="clientId" type="client">
<xsd:annotation>
<xsd:appinfo source="appian.jpa">
@ManyToOne
                     ...

OriginalPostID-77431

OriginalPostID-77431

  Discussion posts and replies are publicly visible

Parents
  • sikhivahans suggested format of xsd did worked.
    There were no errors at appian level but when i am trying to create table, it is throwing errors,
    "An error occurred while trying to modify the data source schema:
    1. Identity column 'payidinteger' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, and constrained to be nonnullable.;
    2. Cannot find the object "dproprEmployeePay" because it does not exist or you do not have permissions.;
    3. Cannot find the object "dproprEmployeePay" because it does not exist or you do not have permissions. (APNX-1-4178-000)"

    Then i have examined the .sql script

    create table [dproprEmployeePay] (
    [payidinteger] numeric(19,2) identity not null,
    [clientidinteger] numeric(19,0) null unique,
    [employeeidinteger] numeric(19,0) null unique,
    --
                        --
                        --
    primary key ([payidinteger])
    );
    alter table [dproprEmployeePay]
    add constraint dprprcdtemplypy_mplyidintgr
    foreign key ([employeeidinteger])
    references [dproprEmployee];

    alter table [dproprEmployeePay]
    add constraint dprprcdtmplypy_clintidintgr
    foreign key ([clientidinteger])
    references [dproprClient];

    Among the errors thrown, 1st one may be reg [payidinteger] numeric(19,2) may be it should be numeric(19,0)
    Dont know why it generated 19,2 when i have given
    <xsd:element name="payId_Integer" nillable="false" type="xsd:integer">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @Id
    @GeneratedValue
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    And remaining 2 may be bcz that it is trying to execute alter on a non-existing table bcz of 1st error.
Reply
  • sikhivahans suggested format of xsd did worked.
    There were no errors at appian level but when i am trying to create table, it is throwing errors,
    "An error occurred while trying to modify the data source schema:
    1. Identity column 'payidinteger' must be of data type int, bigint, smallint, tinyint, or decimal or numeric with a scale of 0, and constrained to be nonnullable.;
    2. Cannot find the object "dproprEmployeePay" because it does not exist or you do not have permissions.;
    3. Cannot find the object "dproprEmployeePay" because it does not exist or you do not have permissions. (APNX-1-4178-000)"

    Then i have examined the .sql script

    create table [dproprEmployeePay] (
    [payidinteger] numeric(19,2) identity not null,
    [clientidinteger] numeric(19,0) null unique,
    [employeeidinteger] numeric(19,0) null unique,
    --
                        --
                        --
    primary key ([payidinteger])
    );
    alter table [dproprEmployeePay]
    add constraint dprprcdtemplypy_mplyidintgr
    foreign key ([employeeidinteger])
    references [dproprEmployee];

    alter table [dproprEmployeePay]
    add constraint dprprcdtmplypy_clintidintgr
    foreign key ([clientidinteger])
    references [dproprClient];

    Among the errors thrown, 1st one may be reg [payidinteger] numeric(19,2) may be it should be numeric(19,0)
    Dont know why it generated 19,2 when i have given
    <xsd:element name="payId_Integer" nillable="false" type="xsd:integer">
    <xsd:annotation>
    <xsd:appinfo source="appian.jpa">
    @Id
    @GeneratedValue
    </xsd:appinfo>
    </xsd:annotation>
    </xsd:element>

    And remaining 2 may be bcz that it is trying to execute alter on a non-existing table bcz of 1st error.
Children
No Data