[ http://issues.apache.org/jira/browse/IBATIS-301?page=all ]
Jeff Butler closed IBATIS-301:
------------------------------
Resolution: Won't Fix
This is not a bug.
DO NOT use overloaded setters. This breaks the JavaBeans specification, and
iBATIS will not support it.
> The datetime database field mapped to wrong overloaded setters type String.
> ---------------------------------------------------------------------------
>
> Key: IBATIS-301
> URL: http://issues.apache.org/jira/browse/IBATIS-301
> Project: iBatis for Java
> Type: Bug
> Environment: Apache Tomcat/5.5.12 - jdk1.5.0_04 Windows XP sybase 12
> Reporter: Vladimir Sakharuk
> Priority: Minor
>
> <select id="getFidInfo" resultClass="com.msci.fidindex.beans.myBean">
> select * from table1 where myid=#myid#
> </select>
> I have around 10 nullable datetime fields in the table1 in sybase. There is
> no explicit mapping set.
> I have follows 2 overloaded setters for each field:
> public void setMoodysRatingDate(Date moodysRatingDate) {
> this.moodysRatingDate = moodysRatingDate;
> }
> public void setMoodysRatingDate(String value) {
> try { this.moodysRatingDate = sybasedate_format.parse(value);} catch
> (Exception ex){} ;
> }
> Surprisingly IBatis call setMoodysRatingDate(String). All other called Date
> version . All implementation are the same. All fields differ only by name. If
> I comment the String version it calls Date one.
> I work around by removing overload : setMoodysRatingDateString(String value)
> ;
> So it is just bug report.
--
This message is automatically generated by JIRA.
-
If you think it was sent incorrectly contact one of the administrators:
http://issues.apache.org/jira/secure/Administrators.jspa
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira