ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Dan Bradley <debrad...@gmail.com>
Subject Changing a sqlMap dynamically?
Date Thu, 06 Oct 2005 14:06:13 GMT
Using iBATIS you normally create an XML file with a sqlMap element
that defines SQL queries that can be referenced by name. Is it also
possible to create these queries dynamically, through Java, instead of
hard-coding them all in XML? I'm hoping to build some framework code
that will programatically create some common queries based on the
properties of an object, instead of writing a "getAll" or "getById"
query for every entity which varies only in the table name.

SqlMapExecutor's query/insert/delete methods require the name of a
mapped statement and don't appear to allow arbitrary SQL. If iBATIS
supports what I'm looking for, where would you hook into the system in
order to create new mappings on the fly?

Thanks.

Mime
View raw message