In this part the target is to create the view model from the XSD to generate an XML document based on one of the XSD elements.
I choose bookListing.
You create a new Model and choose "XML" instead of "Relational"; obviously it asks you the XSD to use and you choose the correct one from the project.
Now you got a new "orange" model (a view model) with an object of type XML document.
The problem is how to fill the XML with relationa data.
The mapping tool comes to help, but you have to know well your DB and the XML you want to generate.
In this easy example you have to fill the book element and the author one: this means two mapping and the second depends on the first since the author depends on the book (in this XML).
So there goes the mapping, not too complicated (you could also write down the query by hand, but the tool is usefull).
I'm just not able to force it to choose "object" conversion instead of "string", but in any case is possible to fix it by hand.
Remember to save before invoking the tools otherwise an annoying popup will remind you that you have not saved.
In the end you have mapped a relational DB to an XML document with ease ... and now what?
Well you can query it with SquirrelSQL or publish it as a web service ... but before you have to do the most important thing create the Virtual DB.
But this is stuff for the next part of this TEIID tutorial.