Loading ...
Sorry, an error occurred while loading the content.

2486Re: [xml-dbms] Re: Retrieving Data from One of Many Tables using a Single Map File

Expand Messages
  • Dongling Ding
    Sep 11 6:20 PM
      Thanks for the comments.

      In my application a user interface accepts query
      requests from users. That means during the run time I
      have to figure out which map and filter file can be
      applied for a query, and then pass those into
      retrieveDocument(). Also, I have to maintain many map
      and filter files. Is that reasonable?

      What about XQuery? Is that going to address the above
      issues? I hope it will.


      Thanks


      Dongling


      --- Ronald Bourret <rpbourret@...> wrote:
      > There are two things going on here.
      >
      > 1) The map file defines the structure (hierarchy) of
      > the retrieved data.
      > Each different hierarchy requires a different map
      > file, although you can
      > enter a given hierarchy at any point.
      >
      > For example, consider the sample sales data, which
      > uses the following
      > hierarchy:
      >
      > Orders
      > / \
      > Items Customers
      > |
      > Parts
      >
      > I can use the map file for this hierarchy to
      > generate XML documents that
      > match this hierarchy, plus the following
      > hierarchies:
      >
      > Items Customers Parts
      > |
      > Parts
      >
      > Note that XML-DBMS allows you to specify the root
      > you want, then follows
      > the hierarchy to the leaves. In other words, I need
      > a separate map file
      > for the following hierarchy, since it omits the
      > parts table:
      >
      > Orders
      > / \
      > Items Customers
      >
      > I also need different map files for other
      > hierarchies, such as the
      > following:
      >
      > Parts Customers etc.
      > | |
      > Items Orders
      > |
      > Items
      > |
      > Parts
      >
      > Furthermore, a map file can define multiple,
      > separate hierarchies
      > (disconnected graphs), although there is generally
      > no reason to do this.
      >
      > 2) The filter file defines three things:
      > a) Any "wrapper" elements that wrap the returned
      > data.
      > b) The root table to use and the select criteria for
      > that table.
      > c) Any additional filters between tables.
      >
      > For example, if I want to retrieve data starting
      > with order number 123
      > and getting all items with a quantity greater than
      > 10, Orders is my root
      > table, order number 123 is my root select criteria,
      > and quantity greater
      > than 10 is my additional filter criteria on the
      > items table.
      >
      > So, to answer your question, you need:
      >
      > 1) Different map files for different hierarchies.
      > 2) Different filter files for different filter
      > values.
      >
      > Note that which filters are used depends on which
      > tables are defined in
      > the hierarchy. For example, if I include a filter
      > for the Foo table but
      > there is no Foo table in the hierarchy, the Foo
      > filter is never used.
      > Similarly, if I include a filter for the Customers
      > table but specify
      > that the Items table is my root table, the Customers
      > filter will be
      > ignored since it is not on the branch of the
      > hierarchy starting with
      > Items.
      >
      > In summary, having different maps and filters is no
      > different than
      > having different SELECT statements in SQL. The only
      > difference is that
      > map and filter files are big and hard to read and
      > SQL is short and easy
      > to read.
      >
      > -- Ron
      >
      > dling61 wrote:
      > >
      > > One more question to follow up this.
      > >
      > > I have a small enterprise data model containing
      > about ten tables. I
      > > also have different queries to select tables. Some
      > of them perform
      > > join operations.
      > >
      > > I want to have a single filter document to cover
      > all the queries I
      > > have. But it seems like XML-DBMS to construct
      > every result set based
      > > on each filter defined in filter document. If I
      > just want to restieve
      > > data from the customer table, XML-DBMS still go
      > through all the
      > > filters defined and process "select". Is that
      > right?
      > >
      > > Do I have to put different filters into different
      > filter files in my
      > > case? Plus, I do want to use retrieveDocumentBySQL
      > in this case.
      >


      __________________________________________________
      Yahoo! - We Remember
      9-11: A tribute to the more than 3,000 lives lost
      http://dir.remember.yahoo.com/tribute
    • Show all 9 messages in this topic