<select id="getWhatever" resultClass="java.util.HashMap" remapResults="true"> $whateverSqlYouWant$ </select>
Larry On 10/6/05, Dan Bradley <[EMAIL PROTECTED]> wrote: > 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. >