ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Niels Beekman" <n.beek...@wis.nl>
Subject RE: 2.3.4.726 and XmlConverter
Date Fri, 17 Oct 2008 06:57:29 GMT
You could easily do this with properties, unless you are connecting to
databases on the fly. Search the archives for some examples of this. We
use this for purposes similar like yours.

 

Niels

________________________________

From: Zsolt Koppany [mailto:zkoppanylist@intland.com] 
Sent: Friday, October 17, 2008 6:41 AM
To: user-java@ibatis.apache.org
Subject: RE: 2.3.4.726 and XmlConverter

 

I'm not sure whether my problem is clear. Please check the code below
(just an example). The expression ${INT_NULL_FIELD_VALUE} has different
value on different database thus during the xml file is read we transfer
the expression into a database dependent string.

 

I understand that we could do that setting the property from Dao but in
this case the Dao would be database dependent what we don't like.

 

Zsolt

 

            <select id="loadBlob" parameterClass="java.util.Map"
resultMap="inputStreamResult" >

                         SELECT $queryParams.fileNameField$ as fileName,

                                     <isEqual property="fetchBlob"
compareValue="true">

 
LENGTH($queryParams.blobFieldName$) AS length,

                                                 $blobFetchStmt$ AS
blobData

                                     </isEqual>

                                     <!-- even when no need to fetch
blob, still have to select a null value, to get the resultmaps satisfied
-->

                                     <isEqual property="fetchBlob"
compareValue="false">

                                                 ${INT_NULL_FIELD_VALUE}
AS length,

                                                 NULL AS blobData

                                     </isEqual>

                           FROM $queryParams.tableName$

                          WHERE $queryParams.idFieldName$=#id#

            </select>

 

Zsolt 

________________________________

From: Clinton Begin [mailto:clinton.begin@gmail.com] 
Sent: Friday, October 17, 2008 4:09 AM
To: user-java@ibatis.apache.org
Subject: Re: 2.3.4.726 and XmlConverter

 

I don't think Zsolt is talking about the XML results/parameters support
in iBATIS.  XMLConverter was a class used to literally translate iBATIS
1.x mapping files into iBATIS 2.x mapping files using XSLT. It allowed
either runtime conversion or batch conversion.  

 

Zsolt could use the old version to do the one-time conversion of all of
his files if he wants, but it sounds like he is extending the class for
some reason, in which case he could just grab the code and make it his
own.

 

Clinton

On Thu, Oct 16, 2008 at 5:02 PM, <Christopher.Mathrusse@sybase.com>
wrote:


As a suggestion Zsolt, iBatis does OR mapping extremely well. What you
are looking for is something that will map Objects into XML extremely
well. Why not take a look at XStream by thoughtworks. I'm using their
library for several projects pertaining to Object -> XML and it handles
them exceptionally well. And by utilizing a library like this it will
give you a clean separation of concern as well as better control over
the XML that you want to generate. 

http://xstream.codehaus.org/ 



"Clinton Begin" <clinton.begin@gmail.com> 

10/16/2008 03:42 PM 

Please respond to 


user-java@ibatis.apache.org

To

user-java@ibatis.apache.org 

cc

 

Subject

Re: 2.3.4.726 and XmlConverter

 

 

 

 

 

 




Zsolt, 

This feature is really old and was only there to support 1.x clients
during the transition to 2.x.  If you're still have 1.x maps, it might
be a good time to move them.  Otherwise, consider it a deprecated
feature.  Thus, the long-term solution is for you to either adopt the
code as your own, or migrate your SQL mapping files. 

cheers
Clinton

On Thu, Oct 16, 2008 at 2:56 PM, Zsolt Koppany
<zkoppanylist@intland.com> wrote: 
Larry,

are there better options that will work long term?

What is the recommended way today?

Zsolt 

> -----Original Message-----
> From: Larry Meadors [mailto:larry.meadors@gmail.com]
> Sent: Thursday, October 16, 2008 3:55 PM
> To: user-java@ibatis.apache.org
> Subject: Re: 2.3.4.726 and XmlConverter
> 
> Two options:
>
>  - stick with the older version of ibatis that has all the parts you
need
>  - extract the parts you need from the older version of ibatis and use
> them alongside the new release
>
> Larry

 


Mime
View raw message