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 Christopher Lamey <cl...@localmatters.com> on 2006/05/10 23:17:43 UTC

two ?s

Hello,

I have a couple questions:

1) Is svn.apache.org, both HTTP and SVN, down?

2) Can I use the groupBy attribute of a resultMap to collapse down rows
from a query that uses a bunch of outer joins?  For example, I have a
query hits a couple directly associated tables, a join table, and a
table off the join table.  I can't get it work right now, but I can't
get any groupBy stuff to work and I'm thinking that's because I'm using
the 2.1.7 release, which has a busted groupBy attribute.

Thanks,
Chris


Re: two ?s

Posted by Jerome Gagner <ph...@gmail.com>.
Wrong email topic. Boy am I on a roll lately.

On 5/10/06, Jerome Gagner <ph...@gmail.com> wrote:
> After being inspired to try and implement this, I gave it a shot with
> the help of my good buddy Larry. However, after actually writing the
> code, he went "oops, the order the maps are loaded is significant!".
>
> In any case, the modifed class and test cases added are attached.
>
>
>
>
>
> On 5/10/06, Larry Meadors <lm...@apache.org> wrote:
> > That would be great - i know there is one on the WIKI already, but
> > take a look and update it if you need to.
> >
> > Larry
> >
> >
> > On 5/10/06, Christopher Lamey <cl...@localmatters.com> wrote:
> > > Hello,
> > >
> > > It turns out the groupBy attribute references a property in the
> > > resultMap, not a column.
> > >
> > > Doh!
> > >
> > > It'd be nice if the iBATIS DataMapper PDF mentioned that on page 29 and
> > > used different names in the example on page 28 (rather than 'quarter'
> > > for everything).
> > >
> > > I'd be willing to put together a FAQ item with an working example of
> > > groupBy hitting two tables via a join if anyone thinks that's useful.
> > >
> > > Cheers,
> > > topher
> > >
> > >
> >
>
>
>

Re: two ?s

Posted by Jerome Gagner <ph...@gmail.com>.
After being inspired to try and implement this, I gave it a shot with
the help of my good buddy Larry. However, after actually writing the
code, he went "oops, the order the maps are loaded is significant!".

In any case, the modifed class and test cases added are attached.





On 5/10/06, Larry Meadors <lm...@apache.org> wrote:
> That would be great - i know there is one on the WIKI already, but
> take a look and update it if you need to.
>
> Larry
>
>
> On 5/10/06, Christopher Lamey <cl...@localmatters.com> wrote:
> > Hello,
> >
> > It turns out the groupBy attribute references a property in the
> > resultMap, not a column.
> >
> > Doh!
> >
> > It'd be nice if the iBATIS DataMapper PDF mentioned that on page 29 and
> > used different names in the example on page 28 (rather than 'quarter'
> > for everything).
> >
> > I'd be willing to put together a FAQ item with an working example of
> > groupBy hitting two tables via a join if anyone thinks that's useful.
> >
> > Cheers,
> > topher
> >
> >
>

Re: two ?s

Posted by Larry Meadors <lm...@apache.org>.
That would be great - i know there is one on the WIKI already, but
take a look and update it if you need to.

Larry


On 5/10/06, Christopher Lamey <cl...@localmatters.com> wrote:
> Hello,
>
> It turns out the groupBy attribute references a property in the
> resultMap, not a column.
>
> Doh!
>
> It'd be nice if the iBATIS DataMapper PDF mentioned that on page 29 and
> used different names in the example on page 28 (rather than 'quarter'
> for everything).
>
> I'd be willing to put together a FAQ item with an working example of
> groupBy hitting two tables via a join if anyone thinks that's useful.
>
> Cheers,
> topher
>
>

Re: two ?s

Posted by Christopher Lamey <cl...@localmatters.com>.
Hello,

It turns out the groupBy attribute references a property in the
resultMap, not a column.

Doh!

It'd be nice if the iBATIS DataMapper PDF mentioned that on page 29 and
used different names in the example on page 28 (rather than 'quarter'
for everything).

I'd be willing to put together a FAQ item with an working example of
groupBy hitting two tables via a join if anyone thinks that's useful.

Cheers,
topher


Re: two ?s

Posted by Christopher Lamey <cl...@localmatters.com>.
As a sanity check regarding the groupBy behavior I'm getting, here are
some log entries:

15:37:30,172 [main] DEBUG java.sql.ResultSet - {rset-100006} Header:
[category_id, category_keyword_id, category_id, keyword, vendor_name]
15:37:30,172 [main] DEBUG java.sql.ResultSet - {rset-100006} Result:
[category2, catkeyword2, category2, Dog, Amacai]
15:37:30,173 [main] DEBUG java.sql.ResultSet - {rset-100006} Result:
[category2, catkey1, category2, Oompa loopa, null]

Does the resultMap's groupBy get confused by two columns with the same
name in the result set?

On Wed, 2006-05-10 at 15:17 -0600, Christopher Lamey wrote:
> Hello,
> 
> I have a couple questions:
> 
> 1) Is svn.apache.org, both HTTP and SVN, down?
> 
> 2) Can I use the groupBy attribute of a resultMap to collapse down rows
> from a query that uses a bunch of outer joins?  For example, I have a
> query hits a couple directly associated tables, a join table, and a
> table off the join table.  I can't get it work right now, but I can't
> get any groupBy stuff to work and I'm thinking that's because I'm using
> the 2.1.7 release, which has a busted groupBy attribute.
> 
> Thanks,
> Chris