ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Alex O <develo...@alexoren.com>
Subject Same queries, different tables
Date Thu, 21 Aug 2008 16:52:10 GMT


Please suggest the best way to customize a set of queries to use different
tables (but same columns).

For example, let's say that I have a humongous amount of customers and the
DBA decided to split into tables by continent.  Let us also assume that
there will be 7 distinct subcomponents and each one only deals with a
particular continent.

So, instead of the current query:
  select name, address, phone from USERS where some_criterion
one component may query:
  select name, address, phone from AFRICA_USERS where some_criterion
while another will query:
  select name, address, phone from EUROPE_USERS where some_criterion

The components will be completely identical except for the tables they will
The number of different queries can be large.

I do not really want to change the code to have the table names passed
explicitly to the ibatis queries.
In particular, some queries have no parameters (or accept a single primitive
parameter) and changing the code to explicitly carry the table names around.

So is it possible to achieve this changing only the XML configuration files?

Thank you,

View this message in context: http://www.nabble.com/Same-queries%2C-different-tables-tp19092704p19092704.html
Sent from the iBATIS - User - Java mailing list archive at Nabble.com.

View raw message