This is a migrated thread and some comments may be shown as answers.

Array Mapping, not recognizing table name during schema generation

4 Answers 46 Views
Data Access Free Edition
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David Hollins
Top achievements
Rank 1
David Hollins asked on 19 Mar 2011, 09:24 PM
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

4 Answers, 1 is accepted

Sort by
0
David Hollins
Top achievements
Rank 1
answered on 23 Mar 2011, 02:48 PM
Can someone from Telerik comment on this?
0
Ady
Telerik team
answered on 24 Mar 2011, 03:35 PM
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
0
David Hollins
Top achievements
Rank 1
answered on 25 Mar 2011, 02:47 AM
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?
0
Ady
Telerik team
answered on 31 Mar 2011, 10:23 AM
Hi David Hollins,

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

Regards,
Ady
the Telerik team
Tags
Data Access Free Edition
Asked by
David Hollins
Top achievements
Rank 1
Answers by
David Hollins
Top achievements
Rank 1
Ady
Telerik team
Share this question
or