Return-Path: Delivered-To: apmail-ibatis-user-java-archive@www.apache.org Received: (qmail 20215 invoked from network); 31 Jul 2007 20:13:37 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 31 Jul 2007 20:13:37 -0000 Received: (qmail 32925 invoked by uid 500); 31 Jul 2007 20:13:34 -0000 Delivered-To: apmail-ibatis-user-java-archive@ibatis.apache.org Received: (qmail 32913 invoked by uid 500); 31 Jul 2007 20:13:34 -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 32902 invoked by uid 99); 31 Jul 2007 20:13:34 -0000 Received: from Unknown (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2007 13:13:34 -0700 X-ASF-Spam-Status: No, hits=2.0 required=10.0 tests=HTML_MESSAGE,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: local policy) Received: from [204.127.225.94] (HELO alnrmhc14.comcast.net) (204.127.225.94) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 31 Jul 2007 20:13:26 +0000 Received: from charlespc (c-24-128-78-170.hsd1.ma.comcast.net[24.128.78.170]) by comcast.net (alnrmhc14) with SMTP id <20070731201305b1400s5g32e>; Tue, 31 Jul 2007 20:13:05 +0000 From: "Charles_Magid" To: In-Reply-To: Subject: RE: Newbie question: execution, invocation, doit, getResults ... Date: Tue, 31 Jul 2007 16:13:04 -0400 Message-ID: MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0029_01C7D38D.AD3FFD90" X-Priority: 3 (Normal) X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook, Build 10.0.6822 Importance: Normal Thread-Index: AcfTrHHG7HUzR26DQbKZGmEaPV7X5AAAokUg X-MimeOLE: Produced By Microsoft MimeOLE V6.0.6000.16480 X-Virus-Checked: Checked by ClamAV on apache.org This is a multi-part message in MIME format. ------=_NextPart_000_0029_01C7D38D.AD3FFD90 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Thank you Jeff that worked fine. -----Original Message----- From: Jeff Butler [mailto:jeffgbutler@gmail.com] Sent: Tuesday, July 31, 2007 3:53 PM To: user-java@ibatis.apache.org Subject: Re: Newbie question: execution, invocation, doit, getResults ... It depends. If you are using one of the generated DAO classes, you can invoke the generated "selectByExample" method. If you are not using DAOs, then you do this: List answer = sqlMap.queryForList("table_namespace.abatorgenerated_selectByExample", pite); Where "table_namespace" is the value in the generated sqlmap.xml for the table. It's easier to use DAOs, but it doesn't look like you using them with the example code below. Jeff Butler On 7/31/07, Charles_Magid wrote: I am an Abator & IBatis newbie. I'm trying to figure out how to invoke my query given the criteria I have established. In other words, what goes in the area labeled "Fill in the blank" below? Reader reader = Resources.getResourceAsReader("com/rbm/db/SqlMapConfig.xml"); SqlMapClient sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader); try { sqlMap.startTransaction(); PromotionitemtextExample pite = new PromotionitemtextExample(); pite.createCriteria().andPromonetPromotionIdEqualTo(4); Promotionitemtext pit = [Fill in the blank] System.out.println(pit.toString()); sqlMap.commitTransaction (); } finally { sqlMap.endTransaction(); } ------=_NextPart_000_0029_01C7D38D.AD3FFD90 Content-Type: text/html; charset="us-ascii" Content-Transfer-Encoding: quoted-printable

Thank you Jeff that worked = fine. 

 

-----Original = Message-----
From: Jeff Butler [mailto:jeffgbutler@gmail.com]
Sent:
Tuesday, July 31, 2007 3:53 = PM
To: = user-java@ibatis.apache.org
Subject: Re: Newbie = question: execution, invocation, doit, getResults ...

 

It depends.

 

If you are using one of the generated DAO = classes, you can invoke the generated "selectByExample" = method.

 

If you are not using DAOs, then you do = this:

 

List answer =3D sqlMap.queryForList("table_namespace.abatorgenerated_selectByExample= ", pite);

 

Where "table_namespace" is the = value in the generated sqlmap.xml for the table.

 

It's easier to use DAOs, but it doesn't look = like you using them with the example code below.

 

Jeff Butler



 

On = 7/31/07, Charles_Magid <Charles_Magid@comcast.net&g= t; wrote:

I am an Abator & IBatis newbie.  I'm trying to figure out how = to invoke my
query given the criteria I have established.  In other words, = what goes in
the area labeled  "Fill in the blank" below?



            &= nbsp;  Reader reader =3D
Resources.getResourceAsReader("com/rbm/db/SqlMapConfig.xml");             &= nbsp;  SqlMapClient sqlMap =3D
SqlMapClientBuilder.buildSqlMapClient(reader);
            &= nbsp;  try {
            &= nbsp;          sqlMap.startTransaction();
            &= nbsp;          PromotionitemtextExample pite =3D new
PromotionitemtextExample();

pite.createCriteria().andPromonetPromotionIdEqualTo(4);
            &= nbsp;          Promotionitemtext pit =3D [Fill in the blank]
            &= nbsp;          System.out.println(pit.toString());
            &= nbsp;          sqlMap.commitTransaction ();
            &= nbsp;  } finally {
            &= nbsp;          sqlMap.endTransaction();

            &= nbsp;  }

 

------=_NextPart_000_0029_01C7D38D.AD3FFD90--