Thanks Kris, I've already found this class. My problem is that in some
cases it's a bit cumbersome to deal with type handlers in XML mapping
file.
It's not a problem for result maps, for example:
<resultMap id="personResult" class="person">
   <result property="birthDate" column="BirthDate" typeHandler="thDate"/>
Once described this result map can be used for any number of queries.
But to apply type handler to a parameter (not a result) I have to use
parameter map, or I have to specify
#parameterName,typeHandler=typeHandlerName#
for every mapped bean property like in the following example.
INSERT INTO Person (ID, â, BirthDate)
VALUES (#id#, â, #birthDate,typeHandler=thDate#)
When using parameter map it is impossible to use bean property names,
only their indices. So mapping and statement would look like
<parameterMap id="personParam" class="person">
   <parameter property="id"/>
   ...
   <parameter property="birthDate" typeHandler="thDate"/>
INSERT INTO Person (ID, â, BirthDate)
VALUES (?, â, ?)
Thus, for every single insert or update statement I have to provide
its own unique parameter map, or I have to specify type handler for
the same property in every update statement.
Am I right in my assumption?
So my suggestion is: it would be nice to create one general parameter
map and then using it with any number update statements providing bean
property names instead of their indices. Is this possible?
Your help will be appreciated.

Reply via email to