You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user-java@ibatis.apache.org by I L <is...@hotmail.com> on 2009/08/16 03:31:26 UTC

Ibatis 3.0 Bugs/Suggestions

Hi,

Awesome product renovation.

Heres some things I found that might have already been discussed:

1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
Getting error if I try to add either <typeAliases> or <typeAlias> in a mapper xml file. Works only in a Configuration.xml file.

2) session.select
I am able to invoke the three param .select(arg0, arg1, arg2) but not .select(id, param). The id/param select isn't available. 

There is no examples in the pdf on how to use the three param select.

3) Is there anyway we can keep the colon syntax for defining jdbcType. It could be in addition to the comma seperated diffinations. Just looks cleaner and is much shorter:
e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}

e.g. 
   count != #{usercount,jdbcType=BIGINT} vs count != #{usercount:BIGINT}


4) It would be nice to have a more straight forward way to get access to Connection
       sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
       vs
       sqlSession.getConnection();

5)
    <select id="isUniqueUsername"  parameterType="map"  resultType="boolean">
        SELECT (count(*) = 0)
        FROM user Where 1=0
    </select>

If I access this select the old fashion way:
       ((Boolean) getSession().selectOne("User.isUniqueUsername", map)).booleanValue();

... I get a "Casting Exception". Apparently a Long is returned instead of a Boolean. I am running on a mysql database. As you know, mysql deals with booleans as bits (1's or 0's). Oddly enough this works fine in the ibatis 2.x versions.

6) Not sure if this will be of any use to anyone, but I've written a CalendarTypeHandler. On the surface, it seems to be working fine


public class CalendarTypeHandler extends BaseTypeHandler {

    public void setNonNullParameter(PreparedStatement ps, int i, Object parameter, JdbcType jdbcType) throws SQLException {
        Calendar calendar = (Calendar) parameter;
        ps.setTimestamp(i, (new Timestamp(calendar.getTimeInMillis())));
    }

    public Object getNullableResult(ResultSet rs, String columnName) throws SQLException {
        java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
        if (sqlTimestamp != null) {
            return new java.util.Date(sqlTimestamp.getTime());
        }
        return null;
    }

    public Object getNullableResult(CallableStatement cs, int columnIndex) throws SQLException {
        java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
        if (sqlTimestamp != null) {
            return new java.util.Date(sqlTimestamp.getTime());
        }
        return null;
    }

}

7) Picky user guide stuff
The User guide is overall very clean, complete, and clear. Great job!!!

a)"....There are two TransactionManager types (i.e. type=”?????”) that are in...". What is the ???? suppose to be?
b) An explanation about the Enum type handler would be nice (like what's persisted, code or index. Is it configurable?)
c) "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..." Get rid of "is"

8) What .selectOne() is isn't clear. Maybe a note that an exception will be thrown if either a list or a null is returned?


Thats all I have found so far. Cheers!


_________________________________________________________________
Windows Live™: Keep your life in sync.
http://windowslive.com/explore?ocid=PID23384::T:WLMTAGL:ON:WL:en-US:NF_BR_sync:082009

Re: Ibatis 3.0 Bugs/Suggestions

Posted by Clinton Begin <cl...@gmail.com>.
I did a SVN reorganization yesterday, and need to update the website.
The apache mirrors don't help things...

Clinton

On Sun, Aug 16, 2009 at 9:09 PM, I L<is...@hotmail.com> wrote:
> Thanks Clinton for the quick response!
>
> re ".selectOne is the equivalent of the old queryForObject"... It looks like
> the new method throws an exception if a null is returned from the db. The
> original didn't do that. Its not a big deal. If I do expect the possibility
> of a null being returned, I can always just catch the exception and handle
> it that way.
>
> re "...hardest methods to name ever"...I know EXACTLY what you mean.
> Sometimes I spend more times thinking about what to call a method than
> coding it!
>
> Cheers!
>
> (P.S., I am now getting the "Not Found" page when trying to download the
> user guide)
> ________________________________
> Date: Sun, 16 Aug 2009 11:28:46 -0600
> Subject: Re: Ibatis 3.0 Bugs/Suggestions
> From: clinton.begin@gmail.com
> To: user-java@ibatis.apache.org
>
> Unfortunately this code isn't terribly clear. That was one of the hardest
> methods to name ever... :-)
>
> JDBC has to make the call to the resultSet before .wasNull will return an
> appropriate value.
>
> So what "getNullableResult" means is "get me a result from the subclass
> typehandler, that might be null, and if it is, take care of it for me with
> the code below..."
>
> So the way it is, is correct, otherwise rs.wasNull() will return the status
> of the previous value.
>
> Clinton
>
> On Sun, Aug 16, 2009 at 10:38 AM, I L <is...@hotmail.com> wrote:
>
> Found a very small performance (milliseconds) change:
>
>
> In BaseTypeHandler.getResult
>
> Instead of:
>     Object result = getNullableResult(rs, columnName);
>     if (rs.wasNull()) {
>       return null;
>     } else {
>       return result;
>     }
>
> I would put the getNullableResult in the else part of the conditional:
>
>     if (rs.wasNull()) {
>       return null;
>     } else {
>       Object result = getNullableResult(rs, columnName);
>       return result;
>     }
>
>
>> Date: Sat, 15 Aug 2009 22:24:40 -0600
>> Subject: Re: Ibatis 3.0 Bugs/Suggestions
>> From: clinton.begin@gmail.com
>> To: user-java@ibatis.apache.org
>>
>> Excellent feedback. I'll start looking into these tomorrow. Thanks.
>>
>> Clinton
>>
>> On Sat, Aug 15, 2009 at 7:31 PM, I L<is...@hotmail.com> wrote:
>> > Hi,
>> >
>> > Awesome product renovation.
>> >
>> > Heres some things I found that might have already been discussed:
>> >
>> > 1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
>> > Getting error if I try to add either <typeAliases> or <typeAlias> in a
>> > mapper xml file. Works only in a Configuration.xml file.
>> >
>> > 2) session.select
>> > I am able to invoke the three param .select(arg0, arg1, arg2) but not
>> > .select(id, param). The id/param select isn't available.
>> >
>> > There is no examples in the pdf on how to use the three param select.
>> >
>> > 3) Is there anyway we can keep the colon syntax for defining jdbcType.
>> > It
>> > could be in addition to the comma seperated diffinations. Just looks
>> > cleaner
>> > and is much shorter:
>> > e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
>> >
>> > e.g.
>> >    count != #{usercount,jdbcType=BIGINT} vs count != #{usercount:BIGINT}
>> >
>> >
>> > 4) It would be nice to have a more straight forward way to get access to
>> > Connection
>> >
>> >
>> > sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
>> >        vs
>> >        sqlSession.getConnection();
>> >
>> > 5)
>> >     <select id="isUniqueUsername"  parameterType="map"
>> > resultType="boolean">
>> >         SELECT (count(*) = 0)
>> >         FROM user Where 1=0
>> >     </select>
>> >
>> > If I access this select the old fashion way:
>> >        ((Boolean) getSession().selectOne("User.isUniqueUsername",
>> > map)).booleanValue();
>> >
>> > ... I get a "Casting Exception". Apparently a Long is returned instead
>> > of a
>> > Boolean. I am running on a mysql database. As you know, mysql deals with
>> > booleans as bits (1's or 0's). Oddly enough this works fine in the
>> > ibatis
>> > 2.x versions.
>> >
>> > 6) Not sure if this will be of any use to anyone, but I've written a
>> > CalendarTypeHandler. On the surface, it seems to be working fine
>> >
>> >
>> > public class CalendarTypeHandler extends BaseTypeHandler {
>> >
>> >     public void setNonNullParameter(PreparedStatement ps, int i, Object
>> > parameter, JdbcType jdbcType) throws SQLException {
>> >         Calendar calendar = (Calendar) parameter;
>> >         ps.setTimestamp(i, (new Timestamp(calendar.getTimeInMillis())));
>> >     }
>> >
>> >     public Object getNullableResult(ResultSet rs, String columnName)
>> > throws
>> > SQLException {
>> >         java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
>> >         if (sqlTimestamp != null) {
>> >             return new java.util.Date(sqlTimestamp.getTime());
>> >         }
>> >         return null;
>> >     }
>> >
>> >     public Object getNullableResult(CallableStatement cs, int
>> > columnIndex)
>> > throws SQLException {
>> >         java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
>> >         if (sqlTimestamp != null) {
>> >             return new java.util.Date(sqlTimestamp.getTime());
>> >         }
>> >         return null;
>> >     }
>> >
>> > }
>> >
>> > 7) Picky user guide stuff
>> > The User guide is overall very clean, complete, and clear. Great job!!!
>> >
>> >
>> > a)"....There are two TransactionManager types (i.e. type=”?????”) that are in...".
>> > What is the ???? suppose to be?
>> > b) An explanation about the Enum type handler would be nice (like what's
>> > persisted, code or index. Is it configurable?)
>> > c)
>> >
>> > "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..."
>> > Get rid of "is"
>> >
>> > 8) What .selectOne() is isn't clear. Maybe a note that an exception will
>> > be
>> > thrown if either a list or a null is returned?
>> >
>> >
>> > Thats all I have found so far. Cheers!
>> >
>> >
>> > ________________________________
>> > Windows Live™: Keep your life in sync. Check it out.
>>
>> ---------------------------------------------------------------------
>> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
>> For additional commands, e-mail: user-java-help@ibatis.apache.org
>>
>
> ________________________________
> Windows Live: Keep your friends up to date with what you do online. Find out
> more.
>
> ________________________________
> Windows Live: Keep your friends up to date with what you do online. Find out
> more.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


RE: Ibatis 3.0 Bugs/Suggestions

Posted by I L <is...@hotmail.com>.
Thanks Clinton for the quick response!

re ".selectOne is the equivalent of the old queryForObject"... It looks like the new method throws an exception if a null is returned from the db. The original didn't do that. Its not a big deal. If I do expect the possibility of a null being returned, I can always just catch the exception and handle it that way.

re "...hardest methods to name ever"...I know EXACTLY what you mean. Sometimes I spend more times thinking about what to call a method than coding it!

Cheers!

(P.S., I am now getting the "Not Found" page when trying to download the user guide)
Date: Sun, 16 Aug 2009 11:28:46 -0600
Subject: Re: Ibatis 3.0 Bugs/Suggestions
From: clinton.begin@gmail.com
To: user-java@ibatis.apache.org

Unfortunately this code isn't terribly clear. That was one of the hardest methods to name ever... :-)

JDBC has to make the call to the resultSet before .wasNull will return an appropriate value.  

So what "getNullableResult" means is "get me a result from the subclass typehandler, that might be null, and if it is, take care of it for me with the code below..."


So the way it is, is correct, otherwise rs.wasNull() will return the status of the previous value.

Clinton

On Sun, Aug 16, 2009 at 10:38 AM, I L <is...@hotmail.com> wrote:






Found a very small performance (milliseconds) change:


In BaseTypeHandler.getResult

Instead of:
    Object result = getNullableResult(rs, columnName);
    if (rs.wasNull()) {
      return null;

    } else {
      return result;
    }

I would put the getNullableResult in the else part of the conditional:
    
    if (rs.wasNull()) {
      return null;
    } else {
      Object result = getNullableResult(rs, columnName);

      return result;
    }


> Date: Sat, 15 Aug 2009 22:24:40 -0600
> Subject: Re: Ibatis 3.0 Bugs/Suggestions
> From: clinton.begin@gmail.com

> To: user-java@ibatis.apache.org
> 
> Excellent feedback. I'll start looking into these tomorrow.  Thanks.

> 
> Clinton
> 
> On Sat, Aug 15, 2009 at 7:31 PM, I L<is...@hotmail.com> wrote:
> > Hi,
> >
> > Awesome product renovation.

> >
> > Heres some things I found that might have already been discussed:
> >
> > 1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd

> > Getting error if I try to add either <typeAliases> or <typeAlias> in a
> > mapper xml file. Works only in a Configuration.xml file.
> >
> > 2) session.select
> > I am able to invoke the three param .select(arg0, arg1, arg2) but not

> > .select(id, param). The id/param select isn't available.
> >
> > There is no examples in the pdf on how to use the three param select.
> >
> > 3) Is there anyway we can keep the colon syntax for defining jdbcType. It

> > could be in addition to the comma seperated diffinations. Just looks cleaner
> > and is much shorter:
> > e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
> >
> > e.g.

> >    count != #{usercount,jdbcType=BIGINT} vs count != #{usercount:BIGINT}
> >
> >
> > 4) It would be nice to have a more straight forward way to get access to
> > Connection

> >
> > sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
> >        vs
> >        sqlSession.getConnection();
> >
> > 5)
> >     <select id="isUniqueUsername"  parameterType="map"

> > resultType="boolean">
> >         SELECT (count(*) = 0)
> >         FROM user Where 1=0
> >     </select>
> >
> > If I access this select the old fashion way:

> >        ((Boolean) getSession().selectOne("User.isUniqueUsername",
> > map)).booleanValue();
> >
> > ... I get a "Casting Exception". Apparently a Long is returned instead of a

> > Boolean. I am running on a mysql database. As you know, mysql deals with
> > booleans as bits (1's or 0's). Oddly enough this works fine in the ibatis
> > 2.x versions.
> >

> > 6) Not sure if this will be of any use to anyone, but I've written a
> > CalendarTypeHandler. On the surface, it seems to be working fine
> >
> >
> > public class CalendarTypeHandler extends BaseTypeHandler {

> >
> >     public void setNonNullParameter(PreparedStatement ps, int i, Object
> > parameter, JdbcType jdbcType) throws SQLException {
> >         Calendar calendar = (Calendar) parameter;

> >         ps.setTimestamp(i, (new Timestamp(calendar.getTimeInMillis())));
> >     }
> >
> >     public Object getNullableResult(ResultSet rs, String columnName) throws
> > SQLException {

> >         java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
> >         if (sqlTimestamp != null) {
> >             return new java.util.Date(sqlTimestamp.getTime());
> >         }

> >         return null;
> >     }
> >
> >     public Object getNullableResult(CallableStatement cs, int columnIndex)
> > throws SQLException {
> >         java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);

> >         if (sqlTimestamp != null) {
> >             return new java.util.Date(sqlTimestamp.getTime());
> >         }
> >         return null;
> >     }
> >
> > }

> >
> > 7) Picky user guide stuff
> > The User guide is overall very clean, complete, and clear. Great job!!!
> >
> > a)"....There are two TransactionManager types (i.e. type=”?????”) that are in...".

> > What is the ???? suppose to be?
> > b) An explanation about the Enum type handler would be nice (like what's
> > persisted, code or index. Is it configurable?)
> > c)
> > "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..."

> > Get rid of "is"
> >
> > 8) What .selectOne() is isn't clear. Maybe a note that an exception will be
> > thrown if either a list or a null is returned?
> >
> >

> > Thats all I have found so far. Cheers!
> >
> >
> > ________________________________
> > Windows Live™: Keep your life in sync. Check it out.
> 

> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org

> For additional commands, e-mail: user-java-help@ibatis.apache.org
> 

Windows Live: Keep your friends up to date with what you do online. Find out more.



_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009

Re: Ibatis 3.0 Bugs/Suggestions

Posted by Clinton Begin <cl...@gmail.com>.
Unfortunately this code isn't terribly clear. That was one of the hardest
methods to name ever... :-)

JDBC has to make the call to the resultSet before .wasNull will return an
appropriate value.

So what "getNullableResult" means is "get me a result from the subclass
typehandler, that might be null, and if it is, take care of it for me with
the code below..."

So the way it is, is correct, otherwise rs.wasNull() will return the status
of the previous value.

Clinton

On Sun, Aug 16, 2009 at 10:38 AM, I L <is...@hotmail.com> wrote:

>  Found a very small performance (milliseconds) change:
>
>
> In BaseTypeHandler.getResult
>
> Instead of:
>     Object result = getNullableResult(rs, columnName);
>     if (rs.wasNull()) {
>       return null;
>     } else {
>       return result;
>     }
>
> I would put the getNullableResult in the else part of the conditional:
>
>     if (rs.wasNull()) {
>       return null;
>     } else {
>       Object result = getNullableResult(rs, columnName);
>       return result;
>     }
>
>
> > Date: Sat, 15 Aug 2009 22:24:40 -0600
> > Subject: Re: Ibatis 3.0 Bugs/Suggestions
> > From: clinton.begin@gmail.com
> > To: user-java@ibatis.apache.org
>
> >
> > Excellent feedback. I'll start looking into these tomorrow. Thanks.
> >
> > Clinton
> >
> > On Sat, Aug 15, 2009 at 7:31 PM, I L<is...@hotmail.com> wrote:
> > > Hi,
> > >
> > > Awesome product renovation.
> > >
> > > Heres some things I found that might have already been discussed:
> > >
> > > 1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
> > > Getting error if I try to add either <typeAliases> or <typeAlias> in a
> > > mapper xml file. Works only in a Configuration.xml file.
> > >
> > > 2) session.select
> > > I am able to invoke the three param .select(arg0, arg1, arg2) but not
> > > .select(id, param). The id/param select isn't available.
> > >
> > > There is no examples in the pdf on how to use the three param select.
> > >
> > > 3) Is there anyway we can keep the colon syntax for defining jdbcType.
> It
> > > could be in addition to the comma seperated diffinations. Just looks
> cleaner
> > > and is much shorter:
> > > e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
> > >
> > > e.g.
> > >    count != #{usercount,jdbcType=BIGINT} vs count !=
> #{usercount:BIGINT}
> > >
> > >
> > > 4) It would be nice to have a more straight forward way to get access
> to
> > > Connection
> > >
> > >
> sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
> > >        vs
> > >        sqlSession.getConnection();
> > >
> > > 5)
> > >     <select id="isUniqueUsername"  parameterType="map"
> > > resultType="boolean">
> > >         SELECT (count(*) = 0)
> > >         FROM user Where 1=0
> > >     </select>
> > >
> > > If I access this select the old fashion way:
> > >        ((Boolean) getSession().selectOne("User.isUniqueUsername",
> > > map)).booleanValue();
> > >
> > > ... I get a "Casting Exception". Apparently a Long is returned instead
> of a
> > > Boolean. I am running on a mysql database. As you know, mysql deals
> with
> > > booleans as bits (1's or 0's). Oddly enough this works fine in the
> ibatis
> > > 2.x versions.
> > >
> > > 6) Not sure if this will be of any use to anyone, but I've written a
> > > CalendarTypeHandler. On the surface, it seems to be working fine
> > >
> > >
> > > public class CalendarTypeHandler extends BaseTypeHandler {
> > >
> > >     public void setNonNullParameter(PreparedStatement ps, int i, Object
> > > parameter, JdbcType jdbcType) throws SQLException {
> > >         Calendar calendar = (Calendar) parameter;
> > >         ps.setTimestamp(i, (new
> Timestamp(calendar.getTimeInMillis())));
> > >     }
> > >
> > >     public Object getNullableResult(ResultSet rs, String columnName)
> throws
> > > SQLException {
> > >         java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
> > >         if (sqlTimestamp != null) {
> > >             return new java.util.Date(sqlTimestamp.getTime());
> > >         }
> > >         return null;
> > >     }
> > >
> > >     public Object getNullableResult(CallableStatement cs, int
> columnIndex)
> > > throws SQLException {
> > >         java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
> > >         if (sqlTimestamp != null) {
> > >             return new java.util.Date(sqlTimestamp.getTime());
> > >         }
> > >         return null;
> > >     }
> > >
> > > }
> > >
> > > 7) Picky user guide stuff
> > > The User guide is overall very clean, complete, and clear. Great job!!!
> > >
> > >
> a)"....There are two TransactionManager types (i.e. type=”?????”) that are in...".
> > > What is the ???? suppose to be?
> > > b) An explanation about the Enum type handler would be nice (like
> what's
> > > persisted, code or index. Is it configurable?)
> > > c)
> > >
> "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..."
> > > Get rid of "is"
> > >
> > > 8) What .selectOne() is isn't clear. Maybe a note that an exception
> will be
> > > thrown if either a list or a null is returned?
> > >
> > >
> > > Thats all I have found so far. Cheers!
> > >
> > >
> > > ________________________________
> > > Windows Live™: Keep your life in sync. Check it out.
> >
> > ---------------------------------------------------------------------
> > To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> > For additional commands, e-mail: user-java-help@ibatis.apache.org
> >
>
> ------------------------------
> Windows Live: Keep your friends up to date with what you do online. Find
> out more.<http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009>
>

RE: Ibatis 3.0 Bugs/Suggestions

Posted by I L <is...@hotmail.com>.
Found a very small performance (milliseconds) change:


In BaseTypeHandler.getResult

Instead of:
    Object result = getNullableResult(rs, columnName);
    if (rs.wasNull()) {
      return null;
    } else {
      return result;
    }

I would put the getNullableResult in the else part of the conditional:
    
    if (rs.wasNull()) {
      return null;
    } else {
      Object result = getNullableResult(rs, columnName);
      return result;
    }


> Date: Sat, 15 Aug 2009 22:24:40 -0600
> Subject: Re: Ibatis 3.0 Bugs/Suggestions
> From: clinton.begin@gmail.com
> To: user-java@ibatis.apache.org
> 
> Excellent feedback. I'll start looking into these tomorrow.  Thanks.
> 
> Clinton
> 
> On Sat, Aug 15, 2009 at 7:31 PM, I L<is...@hotmail.com> wrote:
> > Hi,
> >
> > Awesome product renovation.
> >
> > Heres some things I found that might have already been discussed:
> >
> > 1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
> > Getting error if I try to add either <typeAliases> or <typeAlias> in a
> > mapper xml file. Works only in a Configuration.xml file.
> >
> > 2) session.select
> > I am able to invoke the three param .select(arg0, arg1, arg2) but not
> > .select(id, param). The id/param select isn't available.
> >
> > There is no examples in the pdf on how to use the three param select.
> >
> > 3) Is there anyway we can keep the colon syntax for defining jdbcType. It
> > could be in addition to the comma seperated diffinations. Just looks cleaner
> > and is much shorter:
> > e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
> >
> > e.g.
> >    count != #{usercount,jdbcType=BIGINT} vs count != #{usercount:BIGINT}
> >
> >
> > 4) It would be nice to have a more straight forward way to get access to
> > Connection
> >
> > sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
> >        vs
> >        sqlSession.getConnection();
> >
> > 5)
> >     <select id="isUniqueUsername"  parameterType="map"
> > resultType="boolean">
> >         SELECT (count(*) = 0)
> >         FROM user Where 1=0
> >     </select>
> >
> > If I access this select the old fashion way:
> >        ((Boolean) getSession().selectOne("User.isUniqueUsername",
> > map)).booleanValue();
> >
> > ... I get a "Casting Exception". Apparently a Long is returned instead of a
> > Boolean. I am running on a mysql database. As you know, mysql deals with
> > booleans as bits (1's or 0's). Oddly enough this works fine in the ibatis
> > 2.x versions.
> >
> > 6) Not sure if this will be of any use to anyone, but I've written a
> > CalendarTypeHandler. On the surface, it seems to be working fine
> >
> >
> > public class CalendarTypeHandler extends BaseTypeHandler {
> >
> >     public void setNonNullParameter(PreparedStatement ps, int i, Object
> > parameter, JdbcType jdbcType) throws SQLException {
> >         Calendar calendar = (Calendar) parameter;
> >         ps.setTimestamp(i, (new Timestamp(calendar.getTimeInMillis())));
> >     }
> >
> >     public Object getNullableResult(ResultSet rs, String columnName) throws
> > SQLException {
> >         java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
> >         if (sqlTimestamp != null) {
> >             return new java.util.Date(sqlTimestamp.getTime());
> >         }
> >         return null;
> >     }
> >
> >     public Object getNullableResult(CallableStatement cs, int columnIndex)
> > throws SQLException {
> >         java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
> >         if (sqlTimestamp != null) {
> >             return new java.util.Date(sqlTimestamp.getTime());
> >         }
> >         return null;
> >     }
> >
> > }
> >
> > 7) Picky user guide stuff
> > The User guide is overall very clean, complete, and clear. Great job!!!
> >
> > a)"....There are two TransactionManager types (i.e. type=”?????”) that are in...".
> > What is the ???? suppose to be?
> > b) An explanation about the Enum type handler would be nice (like what's
> > persisted, code or index. Is it configurable?)
> > c)
> > "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..."
> > Get rid of "is"
> >
> > 8) What .selectOne() is isn't clear. Maybe a note that an exception will be
> > thrown if either a list or a null is returned?
> >
> >
> > Thats all I have found so far. Cheers!
> >
> >
> > ________________________________
> > Windows Live™: Keep your life in sync. Check it out.
> 
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
> 

_________________________________________________________________
Windows Live: Keep your friends up to date with what you do online.
http://windowslive.com/Campaign/SocialNetworking?ocid=PID23285::T:WLMTAGL:ON:WL:en-US:SI_SB_online:082009

Re: Ibatis 3.0 Bugs/Suggestions

Posted by Néstor Boscán <ne...@gmail.com>.
One suggestion is to allow PL/SQL Cursor paging. Somehow be able to pass
startRow and countRow for each cursor.
Regards,

Néstor Boscán

On Sat, Aug 15, 2009 at 11:54 PM, Clinton Begin <cl...@gmail.com>wrote:

> Excellent feedback. I'll start looking into these tomorrow.  Thanks.
>
> Clinton
>
> On Sat, Aug 15, 2009 at 7:31 PM, I L<is...@hotmail.com> wrote:
> > Hi,
> >
> > Awesome product renovation.
> >
> > Heres some things I found that might have already been discussed:
> >
> > 1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
> > Getting error if I try to add either <typeAliases> or <typeAlias> in a
> > mapper xml file. Works only in a Configuration.xml file.
> >
> > 2) session.select
> > I am able to invoke the three param .select(arg0, arg1, arg2) but not
> > .select(id, param). The id/param select isn't available.
> >
> > There is no examples in the pdf on how to use the three param select.
> >
> > 3) Is there anyway we can keep the colon syntax for defining jdbcType. It
> > could be in addition to the comma seperated diffinations. Just looks
> cleaner
> > and is much shorter:
> > e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
> >
> > e.g.
> >    count != #{usercount,jdbcType=BIGINT} vs count != #{usercount:BIGINT}
> >
> >
> > 4) It would be nice to have a more straight forward way to get access to
> > Connection
> >
> >
> sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
> >        vs
> >        sqlSession.getConnection();
> >
> > 5)
> >     <select id="isUniqueUsername"  parameterType="map"
> > resultType="boolean">
> >         SELECT (count(*) = 0)
> >         FROM user Where 1=0
> >     </select>
> >
> > If I access this select the old fashion way:
> >        ((Boolean) getSession().selectOne("User.isUniqueUsername",
> > map)).booleanValue();
> >
> > ... I get a "Casting Exception". Apparently a Long is returned instead of
> a
> > Boolean. I am running on a mysql database. As you know, mysql deals with
> > booleans as bits (1's or 0's). Oddly enough this works fine in the ibatis
> > 2.x versions.
> >
> > 6) Not sure if this will be of any use to anyone, but I've written a
> > CalendarTypeHandler. On the surface, it seems to be working fine
> >
> >
> > public class CalendarTypeHandler extends BaseTypeHandler {
> >
> >     public void setNonNullParameter(PreparedStatement ps, int i, Object
> > parameter, JdbcType jdbcType) throws SQLException {
> >         Calendar calendar = (Calendar) parameter;
> >         ps.setTimestamp(i, (new Timestamp(calendar.getTimeInMillis())));
> >     }
> >
> >     public Object getNullableResult(ResultSet rs, String columnName)
> throws
> > SQLException {
> >         java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
> >         if (sqlTimestamp != null) {
> >             return new java.util.Date(sqlTimestamp.getTime());
> >         }
> >         return null;
> >     }
> >
> >     public Object getNullableResult(CallableStatement cs, int
> columnIndex)
> > throws SQLException {
> >         java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
> >         if (sqlTimestamp != null) {
> >             return new java.util.Date(sqlTimestamp.getTime());
> >         }
> >         return null;
> >     }
> >
> > }
> >
> > 7) Picky user guide stuff
> > The User guide is overall very clean, complete, and clear. Great job!!!
> >
> >
> a)"....There are two TransactionManager types (i.e. type=”?????”) that are in...".
> > What is the ???? suppose to be?
> > b) An explanation about the Enum type handler would be nice (like what's
> > persisted, code or index. Is it configurable?)
> > c)
> >
> "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..."
> > Get rid of "is"
> >
> > 8) What .selectOne() is isn't clear. Maybe a note that an exception will
> be
> > thrown if either a list or a null is returned?
> >
> >
> > Thats all I have found so far. Cheers!
> >
> >
> > ________________________________
> > Windows Live™: Keep your life in sync. Check it out.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
> For additional commands, e-mail: user-java-help@ibatis.apache.org
>
>

Re: Ibatis 3.0 Bugs/Suggestions

Posted by Clinton Begin <cl...@gmail.com>.
Excellent feedback. I'll start looking into these tomorrow.  Thanks.

Clinton

On Sat, Aug 15, 2009 at 7:31 PM, I L<is...@hotmail.com> wrote:
> Hi,
>
> Awesome product renovation.
>
> Heres some things I found that might have already been discussed:
>
> 1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
> Getting error if I try to add either <typeAliases> or <typeAlias> in a
> mapper xml file. Works only in a Configuration.xml file.
>
> 2) session.select
> I am able to invoke the three param .select(arg0, arg1, arg2) but not
> .select(id, param). The id/param select isn't available.
>
> There is no examples in the pdf on how to use the three param select.
>
> 3) Is there anyway we can keep the colon syntax for defining jdbcType. It
> could be in addition to the comma seperated diffinations. Just looks cleaner
> and is much shorter:
> e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
>
> e.g.
>    count != #{usercount,jdbcType=BIGINT} vs count != #{usercount:BIGINT}
>
>
> 4) It would be nice to have a more straight forward way to get access to
> Connection
>
> sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
>        vs
>        sqlSession.getConnection();
>
> 5)
>     <select id="isUniqueUsername"  parameterType="map"
> resultType="boolean">
>         SELECT (count(*) = 0)
>         FROM user Where 1=0
>     </select>
>
> If I access this select the old fashion way:
>        ((Boolean) getSession().selectOne("User.isUniqueUsername",
> map)).booleanValue();
>
> ... I get a "Casting Exception". Apparently a Long is returned instead of a
> Boolean. I am running on a mysql database. As you know, mysql deals with
> booleans as bits (1's or 0's). Oddly enough this works fine in the ibatis
> 2.x versions.
>
> 6) Not sure if this will be of any use to anyone, but I've written a
> CalendarTypeHandler. On the surface, it seems to be working fine
>
>
> public class CalendarTypeHandler extends BaseTypeHandler {
>
>     public void setNonNullParameter(PreparedStatement ps, int i, Object
> parameter, JdbcType jdbcType) throws SQLException {
>         Calendar calendar = (Calendar) parameter;
>         ps.setTimestamp(i, (new Timestamp(calendar.getTimeInMillis())));
>     }
>
>     public Object getNullableResult(ResultSet rs, String columnName) throws
> SQLException {
>         java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
>         if (sqlTimestamp != null) {
>             return new java.util.Date(sqlTimestamp.getTime());
>         }
>         return null;
>     }
>
>     public Object getNullableResult(CallableStatement cs, int columnIndex)
> throws SQLException {
>         java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
>         if (sqlTimestamp != null) {
>             return new java.util.Date(sqlTimestamp.getTime());
>         }
>         return null;
>     }
>
> }
>
> 7) Picky user guide stuff
> The User guide is overall very clean, complete, and clear. Great job!!!
>
> a)"....There are two TransactionManager types (i.e. type=”?????”) that are in...".
> What is the ???? suppose to be?
> b) An explanation about the Enum type handler would be nice (like what's
> persisted, code or index. Is it configurable?)
> c)
> "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..."
> Get rid of "is"
>
> 8) What .selectOne() is isn't clear. Maybe a note that an exception will be
> thrown if either a list or a null is returned?
>
>
> Thats all I have found so far. Cheers!
>
>
> ________________________________
> Windows Live™: Keep your life in sync. Check it out.

---------------------------------------------------------------------
To unsubscribe, e-mail: user-java-unsubscribe@ibatis.apache.org
For additional commands, e-mail: user-java-help@ibatis.apache.org


RE: Ibatis 3.0 Bugs/Suggestions

Posted by Poitras Christian <Ch...@ircm.qc.ca>.
For point 5, it seems type handlers are ignored when simple types are set as resultType.


I have a select.

<select id="selectHasRole" resultType="java.lang.Boolean" parameterType="ca.qc.ircm.lims.persistence.mapper.AuthenticatingMapper$RoleTest">

The log does not show my boolean type handler...

2009-09-21 10:55:29,579 - DEBUG - debug - <== Columns: [COUNT(*)] - org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl - (Christian.Poitras@ircm.qc.ca) - 26

2009-09-21 10:55:29,579 - DEBUG - debug - <== Row: [0] - org.apache.ibatis.logging.commons.JakartaCommonsLoggingImpl - (Christian.Poitras@ircm.qc.ca) - 26

2009-09-21 10:55:29,595 - ERROR - logger - java.lang.Long - ca.qc.ircm.lims.web.handler.ExceptionHandler - (Christian.Poitras@ircm.qc.ca) - 36

java.lang.ClassCastException: java.lang.Long

at $Proxy82.selectHasRole(Unknown Source)

at ca.qc.ircm.lims.service.AuthenticatingServiceDefault.hasRole(AuthenticatingServiceDefault.java:63)


Curiously enough, the type handler is used when it's a property of a complex object.

I'll create a JIRA for this.


Christian

________________________________
From: Clinton Begin [mailto:clinton.begin@gmail.com]
Sent: Sunday, August 16, 2009 1:13 PM
To: user-java@ibatis.apache.org
Subject: Re: Ibatis 3.0 Bugs/Suggestions

I've made it through these items... don't take offence to the strikethroughs, I used your list as a sort of TODO list.  :-)

Your comments were very helpful, and offered a different perspective for both the software and the documentation.  It's always amazing how one person might thing something is self explanatory and clear as day, and another sees something completely different.  :-)  I've  implemented the doc advice, and addressed some of the other points below.

Cheers,
Clinton

1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
Getting error if I try to add either <typeAliases> or <typeAlias> in a mapper xml file. Works only in a Configuration.xml file.

This is intentional.  TypeAliases are all defined in the config now.  The old way left it ambiguous as to which type was being referenced, and it became more complicated with cross-mapping references to ResultMaps or statements in other mapping files.

2) session.select
I am able to invoke the three param .select(arg0, arg1, arg2) but not .select(id, param). The id/param select isn't available.

This is a documentation problem if it's not clear.  I'll see what I can do to clear it up.   In a nutshell:

.selectOne is the equivalent of the old queryForObject -- use it when selecting one instance of your result object.
.selectList is the equivalent of the old queryForList -- use it when selecting a list of your result objects.
.select is used when you want to control how your results are loaded with the ResultHandler.

And I think you're right, I don't believe I documented the ResultHandler impl.

3) Is there anyway we can keep the colon syntax for defining jdbcType. It could be in addition to the comma seperated diffinations. Just looks cleaner and is much shorter:
e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}

Certainly there's a way.  :-)  You make a good argument, and I think we can support it.  I'll try to get it in for the next Beta.

4) It would be nice to have a more straight forward way to get access to Connection
       sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
       vs sqlSession.getConnection();

I'll think about that one.  My gut tells me we probably won't support that.  While it would save some typing, we want to discourage it.  The challenge is that sometimes iBATIS can be configured without a datasource (although we also want to discourage that if you want to use lazy loading). Maybe this is something best left to a quick little utility method.

5)  ... I get a "Casting Exception". Apparently a Long is returned instead of a Boolean. I am running on a mysql database. As you know, mysql deals with booleans as bits (1's or 0's). Oddly enough this works fine in the ibatis 2.x versions.

iBATIS 3 is more strict in the typing.   JDBC has a get/setBoolean method pair, so be sure to define your result type as boolean, then this should work.  Otherwise you're literally trying to cast an integer to a boolean.  Note that this relies on the driver's support for translating the 1/0 during the call to get/setBoolean.  Otherwise you'll need to create a DB specific type handler.

6) Not sure if this will be of any use to anyone, but I've written a CalendarTypeHandler. On the surface, it seems to be working fine

I'll create a section on the wiki for contributed type handlers.... once our wiki is back up!  Ticket submitted to atlassian...

7) Picky user guide stuff
The User guide is overall very clean, complete, and clear. Great job!!!

a)"....There are two TransactionManager types (i.e. type="?????") that are in...". What is the ???? suppose to be?
b) An explanation about the Enum type handler would be nice (like what's persisted, code or index. Is it configurable?)
c) "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..." Get rid of "is"

All addressed... thanks for keeping these notes.

8) What .selectOne() is isn't clear. Maybe a note that an exception will be thrown if either a list or a null is returned?

I added a bit to the doc to hopefully clear this up.




On Sat, Aug 15, 2009 at 7:31 PM, I L<is...@hotmail.com>> wrote:
> Hi,
>
> Awesome product renovation.
>
> Heres some things I found that might have already been discussed:
>
> 1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
> Getting error if I try to add either <typeAliases> or <typeAlias> in a
> mapper xml file. Works only in a Configuration.xml file.
>
> 2) session.select
> I am able to invoke the three param .select(arg0, arg1, arg2) but not
> .select(id, param). The id/param select isn't available.
>
> There is no examples in the pdf on how to use the three param select.
>
> 3) Is there anyway we can keep the colon syntax for defining jdbcType. It
> could be in addition to the comma seperated diffinations. Just looks cleaner
> and is much shorter:
> e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
>
> e.g.
>    count != #{usercount,jdbcType=BIGINT} vs count != #{usercount:BIGINT}
>
>
> 4) It would be nice to have a more straight forward way to get access to
> Connection
>
> sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
>        vs
>        sqlSession.getConnection();
>
> 5)
>     <select id="isUniqueUsername"  parameterType="map"
> resultType="boolean">
>         SELECT (count(*) = 0)
>         FROM user Where 1=0
>     </select>
>
> If I access this select the old fashion way:
>        ((Boolean) getSession().selectOne("User.isUniqueUsername",
> map)).booleanValue();
>
> ... I get a "Casting Exception". Apparently a Long is returned instead of a
> Boolean. I am running on a mysql database. As you know, mysql deals with
> booleans as bits (1's or 0's). Oddly enough this works fine in the ibatis
> 2.x versions.
>
> 6) Not sure if this will be of any use to anyone, but I've written a
> CalendarTypeHandler. On the surface, it seems to be working fine
>
>
> public class CalendarTypeHandler extends BaseTypeHandler {
>
>     public void setNonNullParameter(PreparedStatement ps, int i, Object
> parameter, JdbcType jdbcType) throws SQLException {
>         Calendar calendar = (Calendar) parameter;
>         ps.setTimestamp(i, (new Timestamp(calendar.getTimeInMillis())));
>     }
>
>     public Object getNullableResult(ResultSet rs, String columnName) throws
> SQLException {
>         java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
>         if (sqlTimestamp != null) {
>             return new java.util.Date(sqlTimestamp.getTime());
>         }
>         return null;
>     }
>
>     public Object getNullableResult(CallableStatement cs, int columnIndex)
> throws SQLException {
>         java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
>         if (sqlTimestamp != null) {
>             return new java.util.Date(sqlTimestamp.getTime());
>         }
>         return null;
>     }
>
> }
>
> 7) Picky user guide stuff
> The User guide is overall very clean, complete, and clear. Great job!!!
>
> a)"....There are two TransactionManager types (i.e. type="?????") that are in...".
> What is the ???? suppose to be?
> b) An explanation about the Enum type handler would be nice (like what's
> persisted, code or index. Is it configurable?)
> c)
> "The iBATIS XML configuration file is contains settings and properties that have a dramatic effect on how..."
> Get rid of "is"
>
> 8) What .selectOne() is isn't clear. Maybe a note that an exception will be
> thrown if either a list or a null is returned?
>
>
> Thats all I have found so far. Cheers!
>
>
> ________________________________
> Windows Live(tm): Keep your life in sync. Check it out.


Re: Ibatis 3.0 Bugs/Suggestions

Posted by Clinton Begin <cl...@gmail.com>.
I've made it through these items... don't take offence to the
strikethroughs, I used your list as a sort of TODO list.  :-)

Your comments were very helpful, and offered a different perspective for
both the software and the documentation.  It's always amazing how one person
might thing something is self explanatory and clear as day, and another sees
something completely different.  :-)  I've  implemented the doc advice, and
addressed some of the other points below.

Cheers,
Clinton

*1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
Getting error if I try to add either <typeAliases> or <typeAlias> in a
mapper xml file. Works only in a Configuration.xml file.
*
This is intentional.  TypeAliases are all defined in the config now.  The
old way left it ambiguous as to which type was being referenced, and it
became more complicated with cross-mapping references to ResultMaps or
statements in other mapping files.

*2) session.select
I am able to invoke the three param .select(arg0, arg1, arg2) but not
.select(id, param). The id/param select isn't available.
*
This is a documentation problem if it's not clear.  I'll see what I can do
to clear it up.   In a nutshell:

.selectOne is the equivalent of the old queryForObject -- use it when
selecting one instance of your result object.
.selectList is the equivalent of the old queryForList -- use it when
selecting a list of your result objects.
.select is used when you want to control how your results are loaded with
the ResultHandler.

And I think you're right, I don't believe I documented the ResultHandler
impl.

*3) Is there anyway we can keep the colon syntax for defining jdbcType. It
could be in addition to the comma seperated diffinations. Just looks cleaner
and is much shorter:
e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
*
Certainly there's a way.  :-)  You make a good argument, and I think we can
support it.  I'll try to get it in for the next Beta.

*4) It would be nice to have a more straight forward way to get access to
Connection

sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
       vs sqlSession.getConnection();
*
I'll think about that one.  My gut tells me we probably won't support that.
While it would save some typing, we want to discourage it.  The challenge is
that sometimes iBATIS can be configured without a datasource (although we
also want to discourage that if you want to use lazy loading). Maybe this is
something best left to a quick little utility method.

*5)  ... I get a "Casting Exception". Apparently a Long is returned instead
of a Boolean. I am running on a mysql database. As you know, mysql deals
with booleans as bits (1's or 0's). Oddly enough this works fine in the
ibatis 2.x versions.
*
iBATIS 3 is more strict in the typing.   JDBC has a get/setBoolean method
pair, so be sure to define your result type as boolean, then this should
work.  Otherwise you're literally trying to cast an integer to a boolean.
Note that this relies on the driver's support for translating the 1/0 during
the call to get/setBoolean.  Otherwise you'll need to create a DB specific
type handler.

*6) Not sure if this will be of any use to anyone, but I've written a
CalendarTypeHandler. On the surface, it seems to be working fine
*
I'll create a section on the wiki for contributed type handlers.... once our
wiki is back up!  Ticket submitted to atlassian...

*7) Picky user guide stuff
The User guide is overall very clean, complete, and clear. Great job!!!

a)"....There are two TransactionManager types (i.e. type=”?????”) that are
in...". What is the ???? suppose to be?
b) An explanation about the Enum type handler would be nice (like what's
persisted, code or index. Is it configurable?)
c) "The iBATIS XML configuration file is contains settings and properties
that have a dramatic effect on how..." Get rid of "is"
*
All addressed... thanks for keeping these notes.

*8) What .selectOne() is isn't clear. Maybe a note that an exception will be
thrown if either a list or a null is returned?
*
I added a bit to the doc to hopefully clear this up.




On Sat, Aug 15, 2009 at 7:31 PM, I L<is...@hotmail.com> wrote:
> Hi,
>
> Awesome product renovation.
>
> Heres some things I found that might have already been discussed:
>
> 1) http://ibatis.apache.org/dtd/ibatis-3-mapper.dtd
> Getting error if I try to add either <typeAliases> or <typeAlias> in a
> mapper xml file. Works only in a Configuration.xml file.
>
> 2) session.select
> I am able to invoke the three param .select(arg0, arg1, arg2) but not
> .select(id, param). The id/param select isn't available.
>
> There is no examples in the pdf on how to use the three param select.
>
> 3) Is there anyway we can keep the colon syntax for defining jdbcType. It
> could be in addition to the comma seperated diffinations. Just looks
cleaner
> and is much shorter:
> e.g. #{timeZone,jdbcType=VARCHAR} vs #{timeZone:VARCHAR}
>
> e.g.
>    count != #{usercount,jdbcType=BIGINT} vs count != #{usercount:BIGINT}
>
>
> 4) It would be nice to have a more straight forward way to get access to
> Connection
>
>
sqlSession.getConfiguration().getEnvironment().getDataSource().getConnection();
>        vs
>        sqlSession.getConnection();
>
> 5)
>     <select id="isUniqueUsername"  parameterType="map"
> resultType="boolean">
>         SELECT (count(*) = 0)
>         FROM user Where 1=0
>     </select>
>
> If I access this select the old fashion way:
>        ((Boolean) getSession().selectOne("User.isUniqueUsername",
> map)).booleanValue();
>
> ... I get a "Casting Exception". Apparently a Long is returned instead of
a
> Boolean. I am running on a mysql database. As you know, mysql deals with
> booleans as bits (1's or 0's). Oddly enough this works fine in the ibatis
> 2.x versions.
>
> 6) Not sure if this will be of any use to anyone, but I've written a
> CalendarTypeHandler. On the surface, it seems to be working fine
>
>
> public class CalendarTypeHandler extends BaseTypeHandler {
>
>     public void setNonNullParameter(PreparedStatement ps, int i, Object
> parameter, JdbcType jdbcType) throws SQLException {
>         Calendar calendar = (Calendar) parameter;
>         ps.setTimestamp(i, (new Timestamp(calendar.getTimeInMillis())));
>     }
>
>     public Object getNullableResult(ResultSet rs, String columnName)
throws
> SQLException {
>         java.sql.Timestamp sqlTimestamp = rs.getTimestamp(columnName);
>         if (sqlTimestamp != null) {
>             return new java.util.Date(sqlTimestamp.getTime());
>         }
>         return null;
>     }
>
>     public Object getNullableResult(CallableStatement cs, int columnIndex)
> throws SQLException {
>         java.sql.Timestamp sqlTimestamp = cs.getTimestamp(columnIndex);
>         if (sqlTimestamp != null) {
>             return new java.util.Date(sqlTimestamp.getTime());
>         }
>         return null;
>     }
>
> }
>
> 7) Picky user guide stuff
> The User guide is overall very clean, complete, and clear. Great job!!!
>
>
a)"....There are two TransactionManager types (i.e. type=”?????”) that
are in...".
> What is the ???? suppose to be?
> b) An explanation about the Enum type handler would be nice (like what's
> persisted, code or index. Is it configurable?)
> c)
>
"The iBATIS XML configuration file is contains settings and properties
that have a dramatic effect on how..."
> Get rid of "is"
>
> 8) What .selectOne() is isn't clear. Maybe a note that an exception will
be
> thrown if either a list or a null is returned?
>
>
> Thats all I have found so far. Cheers!
>
>
> ________________________________
> Windows Live™: Keep your life in sync. Check it out.