Search code examples
.netibatis

iBatis XML mapper get variable from application


I have an application in NET with iBatis and have many sql script with just one parameter. I want to expand all those with another parameter but it's almost impossible to rewrite all parameterclass. I now have this for example:

<select id="SelectAllByActionIdaction" resultMap="ResultSelectaction" parameterClass="int">
  select a.* from t_action a
  where a.actionid = #value#
</select>

This works fine, but now I want to put another variable on the query. For example like this:

  select a.* from t_actie a
  where a.actieid = #value#
  and a.editUserID = #getCurrentUserID#

The getCurrentUserID is a method which I can call everywhere in my application, how can I manage to let it work in iBatis? That wouldn't be that hard wouldn't be?


Solution

  • It's not possible with iBatis to do such so, it's only possible to do such with parameter mapping, but since I have to many maps allready and every query needs a modification I will look for other solutions.