mybatis invalid comparison: invalid comparison: java.util.Date and java.lang.String

invalid comparison: java.util.Date and java.lang.String
invalid comparison

Solution: in the mapper.xml

<if test="XXX !=null and XXX!=''">

    ! XXX = '' OK to remove it
causes: the empty string and the time of comparison is invalid
because of a bug in mybatis when compared to the time parameters, if the parameters get passed time type with the empty string. '' Comparison determining an exception is raised. Therefore, the above code to the determination, leaving only the non-empty judgment on normal



Guess you like

Origin www.cnblogs.com/youyouxiaosheng-lh/p/11026961.html