ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Ashish Kulkarni <kulkarni_ash1...@yahoo.com>
Subject Re: XML document output from ibatis
Date Tue, 13 Sep 2005 16:07:20 GMT
Parshanth
do you have a code/example of such DAO 

--- Prashanth Sukumaran <prashanthsukumaran@yahoo.com>
wrote:

> Hi Ashish,
>  
> Cool this is fine.  But the idea of a RowHandler is
> to have such conversions out of the DAO.  Also it
> looks clean as if IBatis is returning the Document
> object.  
>  
> The work of the DAO layer is to only execute queries
> and return the data.  You can externalize such
> transformations into the RowHandler.  
>  
> Rgds
> Prashanth Sukumaran.
> 
> Ashish Kulkarni <kulkarni_ash1312@yahoo.com> wrote:
> Hi
> this is a way i got around my problem
> // definiation in xml file
> 
>
parameterClass="java.math.BigDecimal"xmlResultName="PO">//
> SQL querry goes herre
> // to get a list of all data from ibatis
> 
> List list = client.queryForList("getdata", new
> BigDecimal("12345"));
> // go through the list
> for (int i = 0; i < list.size(); i++)
> {
> String obj = (String) list.get(i);
> // get byte array input stream from string 
> ByteArrayInputStream byteArray = new
> ByteArrayInputStream(obj.getBytes());
> // create DMO object 
> Document doc =
> factory.newDocumentBuilder().parse(byteArray);
> }
> 
> 
> Ashish
> 
> 
> --- Larry Meadors wrote:
> 
> > Wit apologies to Clinton, my official opinion on
> > iBATIS XML results is
> > that they suck.
> > 
> > If you want to do what you are describing, do it
> in
> > your DAO class. If
> > you want multiple records, do it with a
> RowHandler.
> > 
> > Larry
> > 
> > 
> > On 9/12/05, Ashish Kulkarni
> > wrote:
> > > Hi
> > > Is it possible to get XML document from ibatis
> > > I am trying to get a XML document as a
> resultClass
> > > from ibatis, here is what i am doing
> > > > > parameterClass="java.math.BigDecimal"> >
> xmlResultName="PO" >> > SELECT A.PCPORD AS PCPORD> >
> from Pu1012> > WHERE A.Pcpord = #value#> >
> > > String str =
> > > (String)client.queryForObject("getPOData",
> poNum);
> > > 
> > > I cannot define resultClass =
> > "org.w3c.dom.Document"
> > > 
> > > Is it possible to do so
> > > 
> > > Ashish
> > > 
> > >
> __________________________________________________
> > > Do You Yahoo!?
> > > Tired of spam? Yahoo! Mail has the best spam
> > protection around
> > > http://mail.yahoo.com
> > >
> > 
> 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam? Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 
> 
> __________________________________________________
> Do You Yahoo!?
> Tired of spam?  Yahoo! Mail has the best spam
> protection around 
> http://mail.yahoo.com 


A$HI$H


		
__________________________________ 
Yahoo! Mail - PC Magazine Editors' Choice 2005 
http://mail.yahoo.com

Mime
View raw message