Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 9974 invoked from network); 12 Jun 2009 02:20:13 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.3) by minotaur.apache.org with SMTP; 12 Jun 2009 02:20:13 -0000 Received: (qmail 61535 invoked by uid 500); 12 Jun 2009 02:20:24 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 61483 invoked by uid 500); 12 Jun 2009 02:20:24 -0000 Mailing-List: contact user-java-help@ibatis.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: user-java@ibatis.apache.org Delivered-To: mailing list user-java@ibatis.apache.org Received: (qmail 61474 invoked by uid 99); 12 Jun 2009 02:20:24 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 02:20:24 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [209.189.248.32] (HELO mail.sexingtechnologies.com) (209.189.248.32) by apache.org (qpsmtpd/0.29) with ESMTP; Fri, 12 Jun 2009 02:20:14 +0000 Received: from localhost (localhost.localdomain [127.0.0.1]) by mail.sexingtechnologies.com (Postfix) with ESMTP id BA2D3718001 for ; Thu, 11 Jun 2009 21:29:39 -0500 (CDT) X-Virus-Scanned: amavisd-new at X-Spam-Score: -4.541 X-Spam-Level: Received: from mail.sexingtechnologies.com ([127.0.0.1]) by localhost (mail.sexingtechnologies.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id WtdThbDDkFZQ for ; Thu, 11 Jun 2009 21:29:38 -0500 (CDT) Received: from mail.sexingtechnologies.com (mail.sexingtechnologies.com [209.189.248.32]) by mail.sexingtechnologies.com (Postfix) with ESMTP id DFFD06F8004 for ; Thu, 11 Jun 2009 21:29:38 -0500 (CDT) Date: Thu, 11 Jun 2009 21:29:38 -0500 (CDT) From: David Brown To: user-java@ibatis.apache.org Message-ID: <156643999.927921244773778749.JavaMail.root@mail> In-Reply-To: <757884665.927901244773308684.JavaMail.root@mail> Subject: Re: IBatis noob/hibernate refugee MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Originating-IP: [12.192.120.19] X-Mailer: Zimbra 5.0.7_GA_2444.RHEL5_64 (ZimbraWebClient - FF3.0 (Win)/5.0.7_GA_2444.RHEL5_64) X-Virus-Checked: Checked by ClamAV on apache.org X-Old-Spam-Flag: NO X-Old-Spam-Status: No, score=-4.541 tagged_above=-10 required=6.6 tests=[ALL_TRUSTED=-1.8, AWL=-0.142, BAYES_00=-2.599] Hello Jeff, thanks for the reply. I suspected as much but now I'm back to s= quare one as my test cases have errors after trying to handcode the Sqlmap.= xml. I even completely commented out and then removed altogether the change= s made but unrelenting the maven test is returning an ugly stack trace. I g= oing to regen: meanwhile suggestions much appreciated. Regards, David. ********************************************** org.springframework.jdbc.BadSqlGrammarException: SqlMapClient operation; ba= d SQL grammar []; nested exception is com.ibatis.common.jdbc.exception.Nest= edSQLException: The error occurred in org/appfuse/dao/ibatis/bullmaster_SqlMap.xml.=20 The error occurred while applying a parameter map. =20 Check the bullmaster.ibatorgenerated_selectByPrimaryKey-InlineParameterMap.= =20 Check the statement (query failed). =20 Cause: com.mysql.jdbc.exceptions.jdbc4.MySQLSyntaxErrorException: Unknown c= olumn 'BreedCode' in 'field list' ----- Original Message ----- From: "Jeff Butler" To: user-java@ibatis.apache.org Sent: Thursday, June 11, 2009 8:54:35 PM GMT -06:00 US/Canada Central Subject: Re: IBatis noob/hibernate refugee Hi David, There's nothing that I know of that generates joins with Ibator. Honestly, it's a big job to do this automatically. It's been a subject on this list many times. For now, hand coding is the way to go. Jeff Butler On Thu, Jun 11, 2009 at 6:08 PM, David Brown wrote: > Hello Jeff, excuse the top post but I just have to say that IBator/IBatis > has saved me a whole bunch of time. I have a 22 column table completely u= nit > tested for both: select and update. Ordinarily, I would still be futsing > around with JDBC or (cringe...) hibernate or some other ORM gadget. > > I have been doing some reading and to cut-to-the-chase I was just > wondering: is there an IBator plugin repo where someone has deposited a > class extending SqlMapConfig that will generate a two or three-way join? = If > not, I'll follow the doco where it says to handcode joins. Regards, David= . > > > > ----- Original Message ----- > From: "David Brown" > To: user-java@ibatis.apache.org > Sent: Thursday, June 11, 2009 10:13:27 AM GMT -06:00 US/Canada Central > Subject: Re: IBatis noob/hibernate refugee > > Hello Jeff, Dude! 4-for-4 por favor! But is there no > programmatic/IBatis/config way to prepend the namespace, in this case, th= e > so-called UsrSql.(dot) to all the getUser and addUser references? If not > that's OK the Usr SQL map is small. At least I'm on my way to a whole bun= ch > of test cases that won't fail. And, IBatis is Mucho Cool! > > Mucho Thanks, > > David. > > > > ----- Original Message ----- > From: "Jeff Butler" > To: user-java@ibatis.apache.org > Sent: Thursday, June 11, 2009 7:55:56 AM GMT -06:00 US/Canada Central > Subject: Re: IBatis noob/hibernate refugee > > There's nothing new under the sun :) > > It's probably still related to namespaces. Once you turn them on, they mu= st > be used everywhere. Look in the Java code for the failing stuff - the > iBATIS call should look like this: > xxx.queryForList("*namespace*.getUsers", parameterObject); > > Note that the SqlMap namespace must precede every SqlMap ID. > > Jeff Butler > > > On Wed, Jun 10, 2009 at 11:08 PM, David Brown < > dbrown@sexingtechnologies.com > > wrote: > > > Hello Jeff, Wow! you're 3-for-3. The truth is I'm using 2 sql maps. The > > original AppFuse map and the new map for my tables. The curiosity is no= w > the > > original sql map is failing the tests and my unit tests are passing?! > Again, > > here is what I am getting in the stack trace: > > > > ************************************************ > > com.ibatis.sqlmap.client.SqlMapException: There is no statement named > > getUsers in this SqlMap > > > > > > Clearly, if I look into the IBatis DAO responsible for generating this > > exception there is a method: getUsers() and the sql.xml seems to > correctly > > reference the method in the sql statement xml elements. > > > > I think I am very close, please advise, David. > > > > > > > > ----- Original Message ----- > > From: "Jeff Butler" > > To: user-java@ibatis.apache.org > > Sent: Wednesday, June 10, 2009 9:19:52 PM GMT -06:00 US/Canada Central > > Subject: Re: IBatis noob/hibernate refugee > > > > My best guess is that you need to enable statement namespaces in your > > SqlMapConfig file. See here for an example (see the element= ): > > http://ibatis.apache.org/docs/tools/ibator/afterRunning.html > > > > Jeff Butler > > > > > > On Wed, Jun 10, 2009 at 7:46 PM, David Brown > > wrote: > > > > > Hello Jeff, thanks a bunch. This really launched everything. IBatis i= s > a > > > real project saver for me as hibernate IMHOP does not fair well with = a > > > sloppy legacy system. I was on-a-roll with IBatis and the AppFuse lig= ht > > CRUD > > > (wicket-ibatis) until I wrote my first test case whereupon I got an > RTE. > > > Please see included below. I've pretty much read the doco but I'm not > > > experienced enough to monkey around with the: _SqlMap.xml. I suspect= I > > need > > > to manually or programmatically fix the whereclause. BTW: do you > consult? > > If > > > so, what is your hourly and minimum? This project is very important t= o > me > > > and I'm undermanned and on a short leash. I sent some money via paypa= l > > to: > > > wickettraining.com but never heard anything back. Anyway, IBatis has > > been > > > great insofar as I nearly just dropped IBatis in the AppFuse project > and > > it > > > never skipped a beat. If you have any ideas or suggestions please > advise, > > > David. > > > > > > > > > > > > **************************************************** > > > Error parsing XPath '/sqlMap/select'. > > > Could not find SQL statement to include with refid > > > 'bullmaster.ibatorgenerated_Example_Where_Clause' > > > > > > > > > > > > ----- Original Message ----- > > > From: "Jeff Butler" > > > To: user-java@ibatis.apache.org > > > Sent: Tuesday, June 9, 2009 2:15:40 PM GMT -06:00 US/Canada Central > > > Subject: Re: IBatis noob/hibernate refugee > > > > > > Here's the sample config file from the Ibator documentation: > > > > > > http://ibatis.apache.org/docs/tools/ibator/configreference/xmlconfig.html > > > > > > < > > > http://ibatis.apache.org/docs/tools/ibator/configreference/xmlconfig.html > > > >Note > > > that is not a child of - rather it = is > a > > > child of . You've probably been reading some ol= d > > > documentation for the prior version of the tool. > > > > > > BTW - welcome to iBATIS! > > > > > > Jeff Butler > > > > > > > > > > > > On Tue, Jun 9, 2009 at 2:13 PM, David Brown > > > wrote: > > > > > > > Hello Jeff, thanks for the speedy and informative reply. I am leani= ng > > > > toward Eclipse (if possible). I have Googled and read some IBatis > doco > > > but I > > > > can't find the reason for the error condition after adding the tag = as > > > > requested: . Please find included below the > > > > > > > criteria and the error condition. Thanks and please advise, David. > > > > > > > > > > > driverClass=3D"com.mysql.jdbc.Driver" > > > > connectionURL=3D"jdbc:mysql://localhost:3306/test" > > > > userId=3D"user" > > > > password=3D"test"> > > > > > > Files/DbVisualizer-6.5.4/jdbc/mysql" > > > > /> > > > > > > > > > > > > ************************************* > > > > The content of element type "jdbcConnection" must match "(property)= *" > > > > > > > > > > > > > > > > > > > > > > > > ----- Original Message ----- > > > > From: "Jeff Butler" > > > > To: user-java@ibatis.apache.org > > > > Sent: Tuesday, June 9, 2009 12:26:08 PM GMT -06:00 US/Canada Centra= l > > > > Subject: Re: IBatis noob/hibernate refugee > > > > > > > > With the eclipse plugin, you should add a element > to > > > > state > > > > where the JDBC driver JAR is. > > > > > > > > With command line, don't add the *iBATIS* JAR, instead add the > *Ibator* > > > > JAR. > > > > > > > > HTH - > > > > Jeff Butler > > > > > > > > On Tue, Jun 9, 2009 at 12:22 PM, David Brown > > > > wrote: > > > > > > > > > Hello IBatis dev, gurus and mortals, I'm an IBatis noob fleeing > from > > > > > hibernate. I have a legacy database that will fair better under > > IBatis > > > if > > > > I > > > > > can get over the learning curve hump. In-all-likelihood this has > been > > > > review > > > > > before but my time constraints will not allow me to languish. I > have > > > > > installed both the Eclipse Ibatis plugin and the command line > > version. > > > I > > > > > both cases I am failing to generate anything. In Eclipse I have > > filled > > > in > > > > > the ibatorConfig.xml but when I right-click the ibatorConfig.xml > file > > > in > > > > the > > > > > Eclipse to run the menu item: Generate IBATIS Artifacts I get a b= ig > > > red-X > > > > > pop dialog the exclaims: Generation Failed. Reason: Unexpected > error > > > > while > > > > > running IBator: Exception getting JDBC driver. > > > > > > > > > > IF I attempt largely the same thing using the command-line: > > > > > > > > > > java -jar ..\..\..\st\dev_tools\ibatis\lib\ibatis-2.3.4.726.jar > > > > -configfile > > > > > ibatorConfig.xml -overwrite > > > > > > > > > > > > > > > I get the following error condition: > > > > > > > > > > > > > > > *************************************************** > > > > > Failed to load Main-Class manifest attribute from > > > > > ..\..\..\st\dev_tools\ibatis\lib\ibatis-2.3.4.726.jar > > > > > > > > > > > > > > > > > > > > Any and all ideas for an IBatis noob will be greatly appreciated. > > > Please > > > > > advise, David. > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > > There are 10 kinds of people in this world: those who understand > > binary > > > > and > > > > > those who don=E2=80=99t (Valid only for 2's complement). > > > > > > > > > > > > > > >