Version: Isomorphic SmartClient/SmartGWT Framework (v13.1p_2024-12-04/Enterprise Deployment 2024-12-04) - Initialization Complete
We're in the process of updating our application to the new 13.1 version that just came out. We have come across an issue with SQL INSERT statements from a SQL data source adding extra fields that do not exist in the table.
We have 2 tables, "hardware" and "hardware_attribute". The relationship is 1 to many through a foreign key in the hardware_attribute table. The data sources look like this:
We use the "attributes" field to send child records to the server, but handle those updates separately in DMI. Inserts with that field present in the data source work without issue in 13.0.
Now in 13.1, we get a "hardware_attribute_id" field in the SQL insert statement for HardwareSQL. This is the primary key to the child table and obviously not present in the parent. We've found that simply removing the "type" from the field definition makes this work without issue, like this:
I'm assuming this is a bug? Or did something change in 13.1 that we would need to be doing differently?
We're in the process of updating our application to the new 13.1 version that just came out. We have come across an issue with SQL INSERT statements from a SQL data source adding extra fields that do not exist in the table.
We have 2 tables, "hardware" and "hardware_attribute". The relationship is 1 to many through a foreign key in the hardware_attribute table. The data sources look like this:
Code:
<DataSource ID="HardwareSQL" serverType="sql" tableName="hardware" dropExtraFields="false"> <fields> <field name="hardwareId" nativeName="hardware_id" type="sequence" hidden="true" primaryKey="true"/> <field name="attributes" type="HardwareAttributeSQL" multiple="true" customSQL="true" hidden="true"/> </fields> </DataSource>
Code:
<DataSource ID="HardwareAttributeSQL" serverType="sql" tableName="hardware_attribute" dropExtraFields="false"> <fields> <field name="hardwareAttributeId" nativeName="hardware_attribute_id" type="sequence" hidden="true" primaryKey="true"/> <field name="hardwareId" nativeName="hardware_id" type="integer" hidden="true" foreignKey="HardwareSQL.hardwareId"/> </fields> </DataSource>
We use the "attributes" field to send child records to the server, but handle those updates separately in DMI. Inserts with that field present in the data source work without issue in 13.0.
Now in 13.1, we get a "hardware_attribute_id" field in the SQL insert statement for HardwareSQL. This is the primary key to the child table and obviously not present in the parent. We've found that simply removing the "type" from the field definition makes this work without issue, like this:
Code:
<field name="attributes" multiple="true" customSQL="true" hidden="true"/>
Comment