hi Marty,
Your query is not in the right context and is doing what you ask. You are doing
a join and as you have to records in the sub table that meet the requirments of
your join ie
WHERE A.ALERT_ID=AC.ALERT_ID then two rows are returned. This is only good for
N:1 situations.
You have a N:M
hi Marty,
Your query is not in the right context and is doing what you ask. You are doing
a join and as you have to records in the sub table that meet the requirments of
your join ie
WHERE A.ALERT_ID=AC.ALERT_ID then two rows are returned. This is only good for
N:1 situations.
You have a N:M
Sounds like as of 2.0.9 there is a way to do what Marty is asking:
# Solution for N+1 selects for 1:M and M:N. Version 2.0 was always
designed for this, I just didn't have a chance to implement it, until
now. It's made possible by two small additions to the mappings
*
Here is an example:
http://article.gmane.org/gmane.comp.java.ibatisdb.user/383
From comparing this example to your original problem Marty, looks like
you have the groupBy on the wrong resultMap. I think you want this:
resultMap id=findAlertsResult class=alert groupBy=id
result property=id
I tried to make a simple example myself using the new groupBy feature
and I think I am having a problem similar to Marty's. I created a
simple author has many books example. I have an Author Object like this:
public class Author {
private Long id;
private String name;
private
I'm sorry, I'm an idiot. I flew off the handle on that one confused the old
select syntax with the new groupBy feature...
I believe you want the groupBy on your child ResultMap.
--- Karen Koch [EMAIL PROTECTED] wrote:
You need two select statements, not a query with a join.
Really, there
Just to follow up, Paul's suggestion to move the groupBy from the criteria
resultMap did correct the problem I had with the null values showing up on the
List of AlertCriteria. The groupBy needs to be on the parent resultMap. My
results now match what Paul outlines more succinctly below.
That
Karen is correct, once I changed my groupBy from author.id to id, it
works as expected. Marty, do you have groupBy=id or
groupBy=alert_id on the findAlertsResult resultMap? I think it should
be groupBy=id.
Karen Koch wrote:
Is your groupBy referring to the parent Java object's property name
-Original Message-
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 10:07 AM
To: Vuppuluri, Vinil (Card Services)
Subject: confirm subscribe to ibatis-user-java@incubator.apache.org
Hi! This is the ezmlm program. I'm managing the
Hi
Is there a way to escape the # characters used
in iBATIS SQL maps ? The reason is ask this is that we are running into a
situation where we need to create
Temporary tables to read from, and
they use the # character. I tried enclosing the statement with ![CDATA[ . ]], but this
works
Have you tried using two pound signs?
INSERT INTO ##tempCount
--- Narasimha Prasad [EMAIL PROTECTED] wrote:
Hi
Is there a way to escape the # characters used in iBATIS SQL maps ?
The
reason is ask this is that we are running into a situation where we
need to
create
Temporary
That did the trick !
Thanks,
Prasad
-Original Message-
From: Ron Grabowski [mailto:[EMAIL PROTECTED]
Sent: Thursday, March 10, 2005 12:57 PM
To: ibatis-user-java@incubator.apache.org
Subject: Re: How to escape special characters (specifically '#')
Have you tried using two pound signs?
That was the correct combination:
- the groupBy must be on the parent resultMap
- the value of the groupBy attribute must be set to the value of the property
on which the grouping occurs
Thank you, Paul and Karen!
Marty
-Original Message-
From: Paul Barry [mailto:[EMAIL PROTECTED]
13 matches
Mail list logo