Announcement

Collapse
No announcement yet.
X
  • Filter
  • Time
Clear All
new posts

  • inheriting dataSources, foreign keys and included fields

    Hello, after seeing this strange error:
    https://forums.smartclient.com/forum...832#post257832

    I wonder if there's some problem with dataSources structured like this:

    Code:
    <DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema"
                ID="JOFC_CARRELLO_DETTAGLI_BASE"
                tableName="JOFC_CARRELLO_DETTAGLI"
                schema="mySchema"
                dbName="myDB"
                serverType="sql"
                requiresAuthentication="true"
    >
        <fields>
    ......
            <field name="ID_ISCRIZIONE_SOCIO_FK" type="integer" foreignKey="JOFC_ISCRIZIONE_SOCIO.ID_REC"/>
    .....
    inheriting ds:
    Code:
    <DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema"
                ID="JOFC_CARRELLO_DETTAGLI_FO"
                tableName="JOFC_CARRELLO_DETTAGLI"
                ....
                inheritsFrom="JOFC_CARRELLO_DETTAGLI_BASE"
    >
        <fields>
    .....
            <field name="ID_SOCIO_FK" type="integer" includeFrom="JOFC_ISCRIZIONE_SOCIO.ID_SOCIO_FK"/>
            <field name="NOME_SOCIO" type="text" includeFrom="JOFC_ISCRIZIONE_SOCIO.JOFC_SOCI.NOME">
    ....
    JOFC_ISCRIZIONE_SOCIO:
    Code:
    <DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema"
                ID="JOFC_ISCRIZIONE_SOCIO"
                tableName="JOFC_ISCRIZIONE_SOCIO"
                ...
                inheritsFrom="JOFC_ISCRIZIONE_SOCIO_BASE"
    >
     ....
    JOFC_ISCRIZIONE_SOCIO_BASE declares the fk:
    Code:
    <DataSource xmlns:fmt="WEB-INF/" xmlns="http://www.smartclient.com/schema"
                ID="JOFC_ISCRIZIONE_SOCIO_BASE"
                tableName="JOFC_ISCRIZIONE_SOCIO"
    ....
    >
        <fields>
    .....
            <field name="ID_SOCIO_FK" type="integer" foreignKey="JOFC_SOCI.ID_REC"/>
    ...
    and then also JOFC_SOCI inherits the ID_REC field from JOFC_SOCI_BASE.

    So, the 'base' dataSources declare the foreign keys using the ID of the inheriting dataSources, and also the inheriting dataSources IDs are used to include fields.

    Is this ok, or am I misusing something?

Working...
X