Hi guys,




Let me just start by saying this is an awesome project! We were using hibernate 
which ended up being too complicated for what we needed. We switched to ibatis 
and it fit like a glove. Keep up the good work!

I am having one issue with maps and calendars. I am passing a Java Map as a 
parameter to the <select> entity. It is a map of objects and has two key-value 
pair. One is a String and the other is a Calendar:

String id => "3333"
Calendar fromDate => Java Calendar

The problem is that ibatis is throwing this error:
----------------------------------
--- The error occurred in com/blahblah/config/AccountEvent.xml.  
--- The error occurred while applying a parameter map.  
--- Check the AccountEvent.findByAccount-InlineParameterMap.  
--- Check the parameter mapping for the 'fromDate' property.  
--- Cause: java.lang.NullPointerException
[Ljava.lang.StackTraceElement;@b036af
----------------------------------

Here is the xml:
    <select id="findByAccount" parameterClass="map" 
resultMap="AccountEventResult">
            SELECT * FROM user_event WHERE create_datetime <![CDATA[ < ]]> 
#fromDate:DATE# AND user_id=#id#
     </select>

----------------------------------

Now, if I pass a Date object instead of a Calendar in the map, it works with no 
issues. We do have a CalendarTypeHandler and if I pass a Calendar as a single 
field (parameterClass="java.util.Calendar") it works. For some reason passing a 
Calendar in a parameter Map just doesn't work. 

Any hints?

_________________________________________________________________
See how Windows Mobile brings your life together—at home, work, or on the go.
http://clk.atdmt.com/MRT/go/msnnkwxp1020093182mrt/direct/01/

Reply via email to