Array Mapping, not recognizing table name during schema generation

5 posts, 0 answers
  1. David Hollins
    David  Hollins avatar
    15 posts
    Member since:
    Dec 2009

    Posted 19 Mar 2011 Link to this post

    In our object we are mapping an array of decimals to a join table.  Here is the XML the wizard created:

                <field name="_discount">
                  <extension key="field" value="_discounts">
                    <extension key="array">
                      <extension key="db-link-table">
                        <extension key="db-table-name" value="MS_RegistrationDiscounts" />
                        <extension key="db-owner-ref">
                          <extension key="db-ref" value="_id">
                            <extension key="db-column">
                              <extension key="db-column-name" value="RegistrationId" />
                            </extension>
                          </extension>
                        </extension>
                        <extension key="db-value">
                          <extension key="db-column">
                            <extension key="db-column-name" value="DiscountAmount" />
                          </extension>
                        </extension>
                        <extension key="db-sequence">
                          <extension key="db-column">
                            <extension key="db-column-name" value="OrderBy" />
                          </extension>
                        </extension>
                      </extension>
                    </extension>
                  </extension>
                </field>

    The problem is when we use the schema tool, the names of the tables and columns for this mapped field are not followed.  Here is the output from the schema executable.

    Table 'MS_Rgstrtns_dscount__discounts' : FAIL
        Table 'MS_Rgstrtns_dscount__discounts' does not exist.
        Constraint 'ref_MS_Rgstrtns_dscnt__dscnts_' does not exist.

    Is this a bug in the schema generator since the XML is getting created or is there something else I have to do to make this work?

    Thanks
  2. David Hollins
    David  Hollins avatar
    15 posts
    Member since:
    Dec 2009

    Posted 23 Mar 2011 Link to this post

    Can someone from Telerik comment on this?
  3. DevCraft banner
  4. Ady
    Admin
    Ady avatar
    589 posts

    Posted 24 Mar 2011 Link to this post

    Hi David Hollins,

     I am terribly sorry for the late reply. I could reproduce the behavior and it does occur when you have a reference to a persistent struct, in the persistent class and the struct has a decimal array. Can you confirm that this is your case?
    We will fix this asap. Is it possible to use a class reference instead? For a struct reference all the fields of the struct are stored in the same table as the class. There is no separate table created for a struct.

    Looking forward to assissting you further.

    All the best,
    Ady
    the Telerik team
  5. David Hollins
    David  Hollins avatar
    15 posts
    Member since:
    Dec 2009

    Posted 24 Mar 2011 Link to this post

    Yes, the array of decimals was in fact stored in a STRUCT class and then included into the main object.  The STRUCT was the optimal way because it only added a single table.  When we use a class, yet another table will be added so we'll have something like:


    Object Table
       Class Table for Object holding array (additional table from switching to class form struct)
          New Table for decimal array


    How soon will this be fixed and be made available?
  6. Ady
    Admin
    Ady avatar
    589 posts

    Posted 31 Mar 2011 Link to this post

    Hi David Hollins,

     We will fix this soon. It should be available in the next service pack.

    Regards,
    Ady
    the Telerik team
Back to Top
DevCraft banner