ibatis-user-java mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Cyril <cyril_j...@yahoo.fr>
Subject RE: Stored procedures and iBatis
Date Thu, 09 Feb 2006 16:50:03 GMT
Some more informations:

Is this solution correct for you? iBatis is intended
to be used this way?

<resultMap id="result-get-contacts" class="Contact" >
    <result property="contactId" column="ID" />
    <result property="contactName" column="NAME" />
    <result property="ContactAddress" column="ADDRESS"
/>
 </resultMap>

 <parameterMap id="params-get-contacts" class="map" >
       <parameter property="beginningOfName"
jdbcType="VARCHAR" mode="IN"/>
 </parameterMap>

<procedure id="getContactsByBeginningOfName"
parameterMap="params-get-contacts"
resultMap="result-get-contacts" >
        { ? = call getContactsByBeginningOfName(?) }
 </procedure>

Map paramMap = new HashMap();
paramMap.put("beginningOfName", "Smi");
List listOfContacts = (List)
sqlMap.queryForList("getContactsByBeginningOfName",
paramMap);

System.out.println(((Contact)
listOfContacts.get(0)).getName);


Cyril

--- Cyril <cyril_jade@yahoo.fr> a écrit :

> Hi !
> 
> I'm auditing iBatis to decide if we choose this
> technologie for our project, but I have quite some
> difficulties to find good documentation about iBatis
> and stored procedures.
> 
> My project chose to call stored procedures for every
> query to the database, and I need to understand how
> iBatis support this.
> 
>
http://ibatisnet.sourceforge.net/DevGuide/ar01s03.html#d0e333
> (chapter 3.2.2) only present a call to a procedure
> which doesn't return any result.
> 
> I read other submission to this list with example,
> but
> usually, I can't find what I want to do: call a
> stored
> procedure returning a list of objects
> 
> For example, how iBatis handle a stored query which
> return a list of Contacts (mapping + java code)?
> Is this possible?
> I read that usually, the stored procedure will
> return
> a Map, but what is in this map?
> Is there instances of the Contact objects? If so, we
> must specify a mapping from the result of the
> procedure to the object, but how?
> 
> Some procedures return multiple result set. Is the
> proposition at
>
http://opensource2.atlassian.com/confluence/oss/display/IBATIS/Improved+Stored+Procedure+Support+Whiteboard
> implemented?
> 
> Many thanks!
> Cyril Gambis
> 
> 
> 	
> 
> 	
> 		
>
___________________________________________________________________________
> 
> Nouveau : téléphonez moins cher avec Yahoo!
> Messenger ! Découvez les tarifs exceptionnels pour
> appeler la France et l'international.
> Téléchargez sur http://fr.messenger.yahoo.com
> 



	

	
		
___________________________________________________________________________ 
Nouveau : téléphonez moins cher avec Yahoo! Messenger ! Découvez les tarifs exceptionnels
pour appeler la France et l'international.
Téléchargez sur http://fr.messenger.yahoo.com

Mime
View raw message