Re: com.ibatis.sqlmap.client.SqlMapException: Duplicate prepared statement found. This is likely a bug.

2006-11-16 Thread Peter Andrews
Thank you Brandon for your replies on this thread. I did end up trying to make a simpler case. I started to use ResultMaps to populate the complex type and can still replicate the problem. Since I believe this is a true iBATIS bug I sent a simplified description and test case to the ibatis dev

Postgres Stored Procedures, wrong return type

2006-11-16 Thread Randy Layman
I'm trying to invoke a stored procedure in Postgres, but I get an error from the Postgres driver saying (The entire stack trace for the exception is at the end of the email): org.postgresql.util.PSQLException: A CallableStatement function was executed and the return was of type java.sql.T

Re: Simple questions

2006-11-16 Thread Koka Kiknadze
I must to use a queryForObject and no a queryForList In your setup if you execute: queryForObject("getMatchList", 5) it will retrieve single Match object having match_id = 5 with child matchScores list populated. if you execute queryForList("getMatchList", 5) it will return List containing all Ma

RE: Simple questions

2006-11-16 Thread Engel, Gregory A
Try changing to a left join on the match scores table LEFT JOIN matchs_scores ON matchs_scores.match_id =matchs.match_id -Original Message- From: soussou97 [mailto:[EMAIL PROTECTED] Sent: Thursday, November 16, 2006 7:39 AM To: user-java@ibatis.apache.org Subject: Re: Simple questions

Re: com.ibatis.sqlmap.client.SqlMapException: Duplicate prepared statement found. This is likely a bug.

2006-11-16 Thread Brandon Goodin
From what i can see of your code you are trying to use iBATIS in more of an Active Record fashion. With iBATIS it is not a good idea to make database calls from within your domain beans. As a general practice, it is best to operate on your domain beans externally either by providing information t

Re: Simple questions

2006-11-16 Thread soussou97
Hi Koka; My question is how get a instance of Match having child MatchScore list populated? Normally its a Match object I must to use a queryForObject and no a queryForList ? Koka Kiknadze wrote: > > Well, if you want specific MatchScore object add another query > > resultMap="matchScoreRes

Re: Simple questions

2006-11-16 Thread Koka Kiknadze
On 11/16/06, soussou97 <[EMAIL PROTECTED]> wrote: I does not understand your response ? With the new version of Ibatis is possible to execute one only query to load all data: match+list of scores ? Yep, it is. But that does not mean you have to use same approach if you ONLY need a MatchSc

Re: Simple questions

2006-11-16 Thread soussou97
Hi Koka; I does not understand your response ? With the new version of Ibatis is possible to execute one only query to load all data: match+list of scores ? Koka Kiknadze wrote: > > Well, if you want specific MatchScore object add another query > > resultMap="matchScoreResult "> > SELECT *

Re: Simple questions

2006-11-16 Thread Koka Kiknadze
Well, if you want specific MatchScore object add another query SELECT * FROM matchs_scores WHERE match_score_id = #value# and use queryForObject. In your example you get instance of Match having child MatchScore list populated bu iBatis, i.e. it's for retrieving Match-es not specific MatchSco

Re: Simple questions

2006-11-16 Thread soussou97
Hi Jeff; I have the following example : Beans : Public class Match { private int matchId; //get & set private List matchScores; //get & set } Public class MatchScore { private int matchScoreId; //get & set private int matchId; //get & set private int score; //get & set private int position; /