two parametr in Mapper method

2009-10-04 Thread Tomáš Procházka
Why not supported this? @Select({"SELECT * FROM send LIMIT #{offset}, #{limit}"}) List getAllItems(int offset, int limit); Its limitation of Java or bug in actual version?   - To unsubscribe, e-mail: user-java-unsubscr...@ib

Re: Case sensitivity in DefaultResultSetHandler

2009-10-04 Thread Martin Ellis
On Fri, Oct 2, 2009 at 9:40 PM, Clinton Begin wrote: > Unfortunately, by coincidence, I'm currently rewriting the entire > DefaultResultSetHandler -- in a serious way.  It's currently in a real state > of flux. > I'll work on it this weekend some more to try to get it to a Beta 4.  Your > feedback

Re: two parametr in Mapper method

2009-10-04 Thread Clinton Begin
It's a limitation in Java. However, we are working on a couple of potential options. But it's not possible to do it the way you've written it (which is really sad, because it's perfectly possible in C# and other languages). Clinton 2009/10/4 Tomáš Procházka > > Why not supported this? > > @Sel

Re: Case sensitivity in DefaultResultSetHandler

2009-10-04 Thread Clinton Begin
You should log a JIRA ticket. Our general rule of thumb is: If it isn't in Jira, it's not getting done. The one I addressed was in SqlRunner and was a Jira ticket logged against the migrations framework. Clinton On Sun, Oct 4, 2009 at 2:41 PM, Martin Ellis wrote: > On Fri, Oct 2, 2009 at 9:4

Re: Case sensitivity in DefaultResultSetHandler

2009-10-04 Thread Clinton Begin
And if you have a patch, you can attach it to the Jira ticket. On Sun, Oct 4, 2009 at 2:41 PM, Martin Ellis wrote: > On Fri, Oct 2, 2009 at 9:40 PM, Clinton Begin > wrote: > > Unfortunately, by coincidence, I'm currently rewriting the entire > > DefaultResultSetHandler -- in a serious way. It'

Re: two parametr in Mapper method

2009-10-04 Thread Guy Rouillier
I'd be curious to understand what the Java limitation is. I would have thought that with Java 1.5's support of varargs, limitations such as this would no longer exists. Of course, to use varargs here, I suppose we'd have to use Object[], which would shoot your type safety. Clinton Begin wrot

Re: two parametr in Mapper method

2009-10-04 Thread Clinton Begin
There's no way to introspect on the parameter names. So your choices become: @Select({"SELECT * FROM send LIMIT #{1}, #{2}"}) List getAllItems(int offset, int limit); ...Or... @Select({"SELECT * FROM send LIMIT #{offset}, #{limit}"}) List getAllItems(@Param("offset") int offset, @Param("limit")

Select one set null instead of throwing exception

2009-10-04 Thread Guy Rouillier
Currently, performing a single row select throws an exception if zero or > 1 rows are returned. While this is certainly workable, an alternative that would be easier on the programmer would be to set the result to null if no rows are found, and only throw an exception if > 1 rows are found.

Re: Select one set null instead of throwing exception

2009-10-04 Thread Guy Rouillier
Ignore this. I realized after taking a break that it doesn't work with primitive types. I think the thing I find most frustrating with Java is that it doesn't treat primitive types in a consistent manner with classes derived from Object. Guy Rouillier wrote: Currently, performing a single ro

Re: two parametr in Mapper method

2009-10-04 Thread Guy Rouillier
I'm glad to see you are considering allowing multiple parameters. I've found having to bind everything into one is cumbersome. What are you thinking of doing for XML? I'd suggest replacing ParameterType with ParameterList, with the latter a cut and paste from the mapper method. Your example