ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Amad Fida <amadf...@yahoo.com>
Subject SQL Query as variable
Date Sat, 24 Dec 2005 23:01:35 GMT

  I have following problem on hand and wondering if iBatis provides anything here. I have
two tables with 95% similar columns, in fact at domain object level one extends from the other.
For resultMaps I use “extends” and I can avoid duplicating lot of sqlmaps. Now the
question is insert and update statements. As “extends” doesn’t make sense for
these so I was wondering if there is anything that I can do to put the common sql (columns
names, value paramters) in some sort of variable and use these variable in my actual sql statement
in a map? This way I can keep one copy and make sure these maps always share common columns.
If you are wondering why i have two tables like that, think of them as production tables an
reporting tables.

Yahoo! Shopping
 Find Great Deals on Holiday Gifts at Yahoo! Shopping 
View raw message