New persistance syntax in XmlToaster 1.0.8
Wednesday, March 5th, 2008We have reviewed how persistance is managed in v1.0.8.
The xmltosql parser has been rewritten to support a more human readable psuedo-sql syntax in addition to the current XML configuration.
An example of updating a table with the new, simplified syntax: If this is the xml message to save to the database….
<message>
<dish id=12>
<dishname>Dry Toast</dishname>
<dishtype>MAIN</dishtype>
<prices>
<retail>1.50</retail>
<wholesale>0.05</wholesale>
</prices>
</dish>
<dish id=14>
:
etc
:
</dish>
</message>
Then the xmltoaster update statement you would need is…
update table menu using (update)
set
dishid = {message.dish.@id, key:1 },
dishname = {message.dish.dishname, type:'string'},
dishtype = {message.dish.type, type:'string'},
price = {message.dish.prices.retail }
;
onError('Error updating the menu table!!.', abort, rollback);
Easy, huh?
