ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Morone, Bill" <Morone.B...@pennmutual.com>
Subject When returning mutiple objects and transforming "directly to xml
Date Thu, 01 Jun 2006 18:55:44 GMT

I have been trying to transform directly to xml from a select statement by doing this:
<sqlMap namespace="ClientholdingApp">
    <statement id="getPolicyList" parameterClass= "java.util.Map" resultClass="xml" xmlResultName="policies">
            KEY_ID as policyId
        from STG_POLICY where servicing_agent = #servicingAgent#        

and this in java (I wasn't able to get it with sqlMap.queryForObject[like an xmlDoc, I figured,
right?]-- kept giving me too many rows):
sqlMap = SqlMapClientBuilder.buildSqlMapClient(reader);             
listOfPolicies = sqlMap.queryForList(GET_POLICY_LIST_STR, params);   

This returns an ArrayList (I believe) of Strings -- each one a row in the recordset, in essence
and a "tiny" xmlDoc of its own -- complete with the xml prolog (<?xml version="1.0" encoding="UTF-8"?>)
-- this wreaks havoc when I try to parse it with the Document Builder.

I can write code to remove that portion of each String for subsequent records, but it would
be nice if there were resultMaps for xml and/or a little more sophistication.

Coming soon, right?

Bill Morone

This message, including any attachments, is intended only for the recipient(s) 
named above. It may contain confidential and privileged information. If you have 
received this communication in error, please notify the sender immediately and 
destroy or delete the original message. Also, please be aware that if you are not 
the intended recipient, any review, disclosure, copying, distribution or any 
action or reliance based on this message is prohibited by law.  

View raw message