[Wsf-general] Data service handling of references

Chamil Thanthrimudalige chamil at wso2.com
Sat Mar 3 08:21:38 PST 2007


On Feb 27, 2007, at 1:01 PM, James Clark wrote:

> I've been using a database with the following structure as an  
> example to
> think about the data service.
>
> A customers table with the following columns:
>
> - id (primary-key, numeric, auto-generated)
> - name
> - date of birth
> - phone number
> - country
>
> A products table with the following columns:
>
> - code (primary-key, alphanumeric, human-specified)
> - description
>
> An orders table with the following columns:
>
> - id (primary-key, numeric, auto-generated)
> - customer_id (references customers.id)
> - status (enumeration)
>
> An order_items table with the following columns:
>
> - order_id (references orders.id)
> - product_code (references products.code)
> - quantity
>
> Imagine I want an operation that gives me information about a  
> particular
> order based on its id. I would like to get back XML something like  
> this.
>
> <order>
>   <id>12345</id>
>   <customerId>678</customerId>
>   <items>
>     <item>
>       <productCode>AA-123</productCode>
>       <quantity>1</quantity>
>     </item>
>     <item>
>       <productCode>BB-456</productCode>
>       <quantity>1000</quantity>
>     </item>
>   </items>
> </order>
>
> In other words, I need to turn the references from the
> order_items.order_id column to the orders.id column that are  
> present in
> the database into hierarchical relationships in the XML.
>
> Most non-toy databases will have this sort of thing.  Microsoft have
> done a lot of stuff in this area. See, e.g.
>
>   http://msdn.microsoft.com/SQLXML
>
> I think we've got to be able to handle this sort of thing.

If we are to do some thing like this we will have to do some  
integration deep into the database and this I think will need the  
WSAS user to be a user who can query system tables about db structure.

Also we will have to extend the query writing language to accommodate  
this.

Best Regards,
Chamil Thanthrimudalige




>
> James
>
>
>
>
>
>
>
> _______________________________________________
> Wsf-general mailing list
> Wsf-general at wso2.org
> http://wso2.org/cgi-bin/mailman/listinfo/wsf-general





More information about the Wsf-general mailing list