RE: Questions on N+1 and ParameterMap

2005-03-10 Thread James, Steven
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

RE: Questions on N+1 and ParameterMap

2005-03-10 Thread James, Steven
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

Re: Questions on N+1 and ParameterMap

2005-03-10 Thread Paul Barry
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 *

Re: Questions on N+1 and ParameterMap

2005-03-10 Thread Paul Barry
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

Re: Questions on N+1 and ParameterMap

2005-03-10 Thread Paul Barry
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

Re: Questions on N+1 and ParameterMap

2005-03-10 Thread Karen Koch
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

RE: Questions on N+1 and ParameterMap

2005-03-10 Thread Marty Tomasi
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

Re: Questions on N+1 and ParameterMap

2005-03-10 Thread Paul Barry
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

RE: confirm subscribe to ibatis-user-java@incubator.apache.org

2005-03-10 Thread Vinil_Vuppuluri
-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

How to escape special characters (specifically '#')

2005-03-10 Thread Narasimha Prasad
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

Re: How to escape special characters (specifically '#')

2005-03-10 Thread Ron Grabowski
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

RE: How to escape special characters (specifically '#')

2005-03-10 Thread Narasimha Prasad
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?

RE: Questions on N+1 and ParameterMap

2005-03-10 Thread Marty Tomasi
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]